diff options
Diffstat (limited to 'rtl')
| -rw-r--r-- | rtl/core/core.sv | 4 | ||||
| -rw-r--r-- | rtl/smp/pe.sv | 14 | ||||
| -rw-r--r-- | rtl/smp/smp_ctrl.sv | 12 | ||||
| -rw-r--r-- | rtl/top/test_smp.sv | 8 |
4 files changed, 30 insertions, 8 deletions
diff --git a/rtl/core/core.sv b/rtl/core/core.sv index ce51a71..cf63b2d 100644 --- a/rtl/core/core.sv +++ b/rtl/core/core.sv @@ -9,6 +9,7 @@ module core input wire step, input wire cpu_halt, + output wire cpu_alive, output wire cpu_halted, output wire breakpoint, @@ -27,6 +28,8 @@ module core generate if (ID < `CONFIG_CPUS) begin: enable + assign cpu_alive = 1; + ptr addr; word data_wr; logic start, write; @@ -57,6 +60,7 @@ module core .* ); end else begin + assign cpu_alive = 0; assign cpu_halted = 1; assign breakpoint = 0; 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), diff --git a/rtl/top/test_smp.sv b/rtl/top/test_smp.sv index df417c3..e6a66e8 100644 --- a/rtl/top/test_smp.sv +++ b/rtl/top/test_smp.sv @@ -9,11 +9,15 @@ module test_smp 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, |
