URL
https://opencores.org/ocsvn/oms8051mini/oms8051mini/trunk
Subversion Repositories oms8051mini
[/] [oms8051mini/] [trunk/] [verif/] [tb/] [tb_tasks.v] - Rev 10
Go to most recent revision | Compare with Previous | Blame | View Log
initial begin reg_cs = 0; reg_be = 4'h0; reg_id = 0; end task cpu_read; input [3:0] block_id; input [15:0] address; output [31:0] read_data; begin @(posedge app_clk); reg_id = block_id; reg_cs = 1; reg_wr = 0; reg_be = 4'hF; reg_addr = address; @(posedge reg_ack); #1 read_data = reg_rdata; @(posedge app_clk); reg_cs = 0; //$display ("Config-Read: Id: %h Addr = %h, Data = %h", block_id,address, read_data); end endtask task cpu_write; input [3:0] block_id; // 0/1/2 --> ram/spi/uart input [15:0] address; input [31:0] write_data; begin $display ("Config-Write: Id: %h Addr = %h, Cfg. Data = %h", block_id,address, write_data); @(posedge app_clk); reg_id = block_id; reg_cs = 1; reg_wr = 1; reg_be = 4'hF; reg_addr = address; reg_wdata = write_data; @(posedge reg_ack); @(posedge app_clk); reg_cs = 0; reg_wr = 0; end endtask
Go to most recent revision | Compare with Previous | Blame | View Log