From 87a42e555bf952047e287f4c7810cd538595d5af Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Wed, 15 Nov 2023 19:10:34 -0600 Subject: rtl/smp: implement SMP dead/alive handling --- rtl/smp/pe.sv | 14 ++++++++++---- rtl/smp/smp_ctrl.sv | 12 ++++++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'rtl/smp') diff --git a/rtl/smp/pe.sv b/rtl/smp/pe.sv index 212ce5a..5c675ee 100644 --- a/rtl/smp/pe.sv +++ b/rtl/smp/pe.sv @@ -8,7 +8,8 @@ module smp_pe input logic[7:0] writedata, output logic[7:0] readdata, - input logic cpu_halted, + input logic cpu_alive, + cpu_halted, breakpoint, output logic halt, @@ -22,11 +23,16 @@ module smp_pe struct packed { - logic breakpoint, cpu_halted; - } status; + logic alive, breakpoint, cpu_halted; + } status, status_out; assign req = writedata[$bits(req) - 1:0]; - assign readdata = {{(8 - $bits(status)){1'b0}}, status}; + assign readdata = {{(8 - $bits(status_out)){1'b0}}, status_out}; + + always_comb begin + status_out = status; + status_out.alive = cpu_alive; + end always @(posedge clk or negedge rst_n) if (!rst_n) begin diff --git a/rtl/smp/smp_ctrl.sv b/rtl/smp/smp_ctrl.sv index 4d6d1a5..2bf812e 100644 --- a/rtl/smp/smp_ctrl.sv +++ b/rtl/smp/smp_ctrl.sv @@ -8,11 +8,15 @@ module smp_ctrl input logic[31:0] avl_writedata, output logic[31:0] avl_readdata, - input logic cpu_halted_0, + input logic cpu_alive_0, + cpu_alive_1, + cpu_alive_2, + cpu_alive_3, + cpu_halted_0, cpu_halted_1, cpu_halted_2, cpu_halted_3, - input logic breakpoint_0, + breakpoint_0, breakpoint_1, breakpoint_2, breakpoint_3, @@ -41,6 +45,7 @@ module smp_ctrl ( .step(step_0), .halt(halt_0), + .cpu_alive(cpu_alive_0), .cpu_halted(cpu_halted_0), .breakpoint(breakpoint_0), .readdata(readdata_0), @@ -52,6 +57,7 @@ module smp_ctrl ( .step(step_1), .halt(halt_1), + .cpu_alive(cpu_alive_1), .cpu_halted(cpu_halted_1), .breakpoint(breakpoint_1), .readdata(readdata_1), @@ -63,6 +69,7 @@ module smp_ctrl ( .step(step_2), .halt(halt_2), + .cpu_alive(cpu_alive_2), .cpu_halted(cpu_halted_2), .breakpoint(breakpoint_2), .readdata(readdata_2), @@ -74,6 +81,7 @@ module smp_ctrl ( .step(step_3), .halt(halt_3), + .cpu_alive(cpu_alive_3), .cpu_halted(cpu_halted_3), .breakpoint(breakpoint_3), .readdata(readdata_3), -- cgit v1.2.3