update todos
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
../../src/verilog/memory_controller.sv
|
../../src/verilog/memory_controller.sv
|
||||||
../../src/verilog/chip_top.sv
|
../../src/verilog/chip_top.sv
|
||||||
|
|
||||||
// TODO: Your CPU RTL. Update this section with your added files.
|
// Your CPU RTL. Update this section with your added files.
|
||||||
../../src/verilog/cpu/cpu_pkg.sv
|
../../src/verilog/cpu/cpu_pkg.sv
|
||||||
../../src/verilog/cpu/reg_file.sv
|
../../src/verilog/cpu/reg_file.sv
|
||||||
../../src/verilog/cpu/fetch.sv
|
../../src/verilog/cpu/fetch.sv
|
||||||
|
|||||||
@@ -3,7 +3,10 @@
|
|||||||
* driver through xbar_box. The sequencer describes intent but never drives or
|
* driver through xbar_box. The sequencer describes intent but never drives or
|
||||||
* observes the DUT directly.
|
* observes the DUT directly.
|
||||||
*/
|
*/
|
||||||
class cpu_sequencer #(int DataSize=32, int AddrSize=14);
|
class cpu_sequencer #(
|
||||||
|
int DataSize = 32,
|
||||||
|
int AddrSize = 14
|
||||||
|
);
|
||||||
|
|
||||||
mailbox #(cpu_xbar_item #(DataSize, AddrSize)) xbar_box;
|
mailbox #(cpu_xbar_item #(DataSize, AddrSize)) xbar_box;
|
||||||
|
|
||||||
@@ -32,9 +35,8 @@ class cpu_sequencer #(int DataSize=32, int AddrSize=14);
|
|||||||
int prog_len;
|
int prog_len;
|
||||||
|
|
||||||
if ((num < 0) || (num >= ISRAM_WORDS)) begin
|
if ((num < 0) || (num >= ISRAM_WORDS)) begin
|
||||||
$fatal(1,
|
$fatal(1, "%0t Seq: program needs 0..%0d random instructions, got %0d", $time,
|
||||||
"%0t Seq: program needs 0..%0d random instructions, got %0d",
|
ISRAM_WORDS - 1, num);
|
||||||
$time, ISRAM_WORDS - 1, num);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
prog_len = num + 1; // +1 for the ebreak
|
prog_len = num + 1; // +1 for the ebreak
|
||||||
@@ -49,19 +51,16 @@ class cpu_sequencer #(int DataSize=32, int AddrSize=14);
|
|||||||
instr.reg_snapshot[r] = shadow.regs[r];
|
instr.reg_snapshot[r] = shadow.regs[r];
|
||||||
end
|
end
|
||||||
if (!instr.randomize()) begin
|
if (!instr.randomize()) begin
|
||||||
$fatal(1, "%0t Seq: state-aware randomization failed for instruction %0d",
|
$fatal(1, "%0t Seq: state-aware randomization failed for instruction %0d", $time, i);
|
||||||
$time, i);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
// Keep this independent diagnostic while c_mem_align is a member
|
// Keep this independent diagnostic while c_mem_align is a member
|
||||||
// TODO. If it fires, the generated instruction violated the
|
// If it fires, the generated instruction violated the
|
||||||
// effective-address contract described on that constraint.
|
// effective-address contract described on that constraint.
|
||||||
if (instr.op inside {OP_LW, OP_SW}) begin
|
if (instr.op inside {OP_LW, OP_SW}) begin
|
||||||
effective_addr = instr.reg_snapshot[instr.rs1] + instr.imm;
|
effective_addr = instr.reg_snapshot[instr.rs1] + instr.imm;
|
||||||
if ((effective_addr[1:0] != 2'b00) ||
|
if ((effective_addr[1:0] != 2'b00) || (effective_addr > ((DSRAM_WORDS * 4) - 4))) begin
|
||||||
(effective_addr > ((DSRAM_WORDS * 4) - 4))) begin
|
$fatal(1, "%0t Seq: illegal effective byte address 0x%08x for %s; complete c_mem_align",
|
||||||
$fatal(1,
|
|
||||||
"%0t Seq: illegal effective byte address 0x%08x for %s; complete c_mem_align",
|
|
||||||
$time, effective_addr, instr.asm());
|
$time, effective_addr, instr.asm());
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -99,7 +98,8 @@ class cpu_sequencer #(int DataSize=32, int AddrSize=14);
|
|||||||
shadow.step();
|
shadow.step();
|
||||||
end
|
end
|
||||||
if (!shadow.halted) begin
|
if (!shadow.halted) begin
|
||||||
$fatal(1,
|
$fatal(
|
||||||
|
1,
|
||||||
"%0t Seq: generated control flow missed the final ebreak (pc=0x%08x); complete c_branch_target",
|
"%0t Seq: generated control flow missed the final ebreak (pc=0x%08x); complete c_branch_target",
|
||||||
$time, shadow.pc);
|
$time, shadow.pc);
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user