fix bus debugger for read program

This commit is contained in:
Raphael Jacquot 2019-03-18 07:33:52 +01:00
parent dd9faf509e
commit 6fcf04a5c0
2 changed files with 8 additions and 6 deletions

View file

@ -237,7 +237,7 @@ always @(posedge i_clk) begin
end end
`ifdef SIM `ifdef SIM
if (cycle_ctr == 320) begin if (cycle_ctr == 370) begin
bus_halt <= 1'b1; bus_halt <= 1'b1;
$display("BUS %0d: [%d] enough cycles for now", phase, cycle_ctr); $display("BUS %0d: [%d] enough cycles for now", phase, cycle_ctr);
end end

View file

@ -289,10 +289,12 @@ always @(posedge i_clk) begin
bus_busy <= 1'b1; bus_busy <= 1'b1;
/* data for the debugger */ /* data for the debugger */
if (!ctrl_unit_prog_data[5]) begin
dbg_bus_info <= 1'b1; dbg_bus_info <= 1'b1;
dbg_bus_action <= { 1'b0, ctrl_unit_prog_data[4]}; dbg_bus_action <= { 1'b0, ctrl_unit_prog_data[4]};
dbg_bus_data <= ctrl_unit_prog_data[3:0]; dbg_bus_data <= ctrl_unit_prog_data[3:0];
end end
end
/* /*
* nothing to send, see if we can read, and do it * nothing to send, see if we can read, and do it
*/ */
@ -325,7 +327,7 @@ always @(posedge i_clk) begin
end end
/* at that poing, we read data in for the debugger */ /* at that poing, we read data in for the debugger */
if (!bus_busy && !alu_busy) begin if ((!bus_busy && !alu_busy) || bus_read) begin
dbg_bus_info <= 1'b1; dbg_bus_info <= 1'b1;
dbg_bus_action <= 2'b10; dbg_bus_action <= 2'b10;
dbg_bus_data <= i_bus_nibble_in; dbg_bus_data <= i_bus_nibble_in;