mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-03-12 10:06:47 -04:00
PoC: tb: Add fetch instruction helper task to tb_tk1
This commit is contained in:
parent
ed10222999
commit
e9f72a8530
@ -378,6 +378,24 @@ module tb_tk1 ();
|
||||
endtask // read_check_word
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// fetch_instruction()
|
||||
//
|
||||
// Simulate fetch of an instruction at specified address.
|
||||
//----------------------------------------------------------------
|
||||
task fetch_instruction(input [31 : 0] address);
|
||||
begin : fetch_instruction
|
||||
tb_cpu_addr = address;
|
||||
tb_cpu_instr = 1'h1;
|
||||
tb_cpu_valid = 1'h1;
|
||||
#(CLK_PERIOD);
|
||||
tb_cpu_addr = 32'h0;
|
||||
tb_cpu_instr = 1'h0;
|
||||
tb_cpu_valid = 1'h0;
|
||||
end
|
||||
endtask // fetch_instruction
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// test1()
|
||||
// Read out name and version.
|
||||
@ -634,10 +652,7 @@ module tb_tk1 ();
|
||||
$display("--- test9: force_trap before illegal access: 0x%1x", tb_force_trap);
|
||||
$display("--- test9: Creating an illegal access.");
|
||||
|
||||
tb_cpu_addr = 32'h13371337;
|
||||
tb_cpu_instr = 1'h1;
|
||||
tb_cpu_valid = 1'h1;
|
||||
#(2 * CLK_PERIOD);
|
||||
fetch_instruction(32'h13371337);
|
||||
$display("--- test9: cpu_addr: 0x%08x, cpu_instr: 0x%1x, cpu_valid: 0x%1x", tb_cpu_addr,
|
||||
tb_cpu_instr, tb_cpu_valid);
|
||||
$display("--- test9: force_trap: 0x%1x", tb_force_trap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user