mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-11-27 19:00:52 -05:00
PoC: tb: Add fetch instruction helper task to tb_tk1
This commit is contained in:
parent
a646c8bfb4
commit
5c56304b5d
1 changed files with 19 additions and 4 deletions
|
|
@ -378,6 +378,24 @@ module tb_tk1 ();
|
||||||
endtask // read_check_word
|
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()
|
// test1()
|
||||||
// Read out name and version.
|
// 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: force_trap before illegal access: 0x%1x", tb_force_trap);
|
||||||
$display("--- test9: Creating an illegal access.");
|
$display("--- test9: Creating an illegal access.");
|
||||||
|
|
||||||
tb_cpu_addr = 32'h13371337;
|
fetch_instruction(32'h13371337);
|
||||||
tb_cpu_instr = 1'h1;
|
|
||||||
tb_cpu_valid = 1'h1;
|
|
||||||
#(2 * CLK_PERIOD);
|
|
||||||
$display("--- test9: cpu_addr: 0x%08x, cpu_instr: 0x%1x, cpu_valid: 0x%1x", tb_cpu_addr,
|
$display("--- test9: cpu_addr: 0x%08x, cpu_instr: 0x%1x, cpu_valid: 0x%1x", tb_cpu_addr,
|
||||||
tb_cpu_instr, tb_cpu_valid);
|
tb_cpu_instr, tb_cpu_valid);
|
||||||
$display("--- test9: force_trap: 0x%1x", tb_force_trap);
|
$display("--- test9: force_trap: 0x%1x", tb_force_trap);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue