Commit fa62367d authored by Javier Díaz's avatar Javier Díaz Committed by Miguel Jimenez Lopez

including sdb support, moving i2c to wrcore

parent 4744ff0a
action = "simulation"
target = "xilinx"
fetchto = "../../ip_cores"
vlog_opt="+incdir+../../sim"
files = [ "main.sv" ]
modules = { "local" : "../.." }
`timescale 1ns/1ps
`include "tbi_utils.sv"
`include "simdrv_defs.svh"
`include "if_wb_master.svh"
module main;
wire clk_ref;
wire clk_sys;
wire rst_n;
wire clk_sys_dly;
wire time_valid;
IWishboneMaster WB (
.clk_i(clk_sys),
.rst_n_i(rst_n));
tbi_clock_rst_gen
#(
.g_rbclk_period(8000))
clkgen(
.clk_ref_o(clk_ref),
.clk_sys_o(clk_sys),
.rst_n_o(rst_n));
assign #10 clk_sys_dly = clk_sys;
assign #1 time_valid =1'b1;
wrsw_dio
#(
.g_interface_mode(PIPELINED),
.g_address_granularity(BYTE))
DUT(
.clk_sys_i (clk_sys),
.clk_ref_i (clk_ref),
.rst_n_i (rst_n),
.tm_time_valid_i(time_valid),
.wb_cyc_i (WB.master.cyc),
.wb_stb_i (WB.master.stb),
.wb_we_i (WB.master.we),
.wb_sel_i (4'b1111),
.wb_adr_i (WB.master.adr[31:0]),
.wb_dat_i (WB.master.dat_o),
.wb_dat_o (WB.master.dat_i),
.wb_ack_o (WB.master.ack),
.wb_stall_o(WB.master.stall)
);
initial begin
CWishboneAccessor acc;
uint64_t data;
@(posedge rst_n);
repeat(3) @(posedge clk_sys);
#1us;
acc = WB.get_accessor();
acc.set_mode(PIPELINED);
#1us;
acc.write(32'h00000000, 'hdeadbeef);
//acc.write(32'h00008000, 'hdeadbeef);
//#1us;
acc.write(32'h00000004, 'hcafebabe);
//acc.write(32'h00008004, 'hcafebabe);
/* acc.read(32'h00000000, data);
acc.read(32'h00000004, data);
//acc.read(32'h00008000, data);
//acc.read(32'h00008004, data);
acc.write(32'h0000004c, 'habcdef00);
acc.read(32'h00000004c, data); */
end
endmodule // main
vlog -sv main.sv +incdir+"." +incdir+../../sim
make -f Makefile
vsim -L unisim -t 10fs work.main -voptargs="+acc"
set StdArithNoWarnings 1
set NumericStdNoWarnings 1
do wave.do
radix -hexadecimal
run 25us
wave zoomfull
radix -hexadecimal
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /main/DUT/clk_sys_i
add wave -noupdate /main/DUT/clk_ref_i
add wave -noupdate /main/DUT/rst_n_i
add wave -noupdate /main/DUT/tm_time_valid_i
add wave -divider WB
add wave -noupdate /main/DUT/wb_cyc_i
add wave -noupdate /main/DUT/wb_stb_i
add wave -noupdate /main/DUT/wb_we_i
add wave -noupdate /main/DUT/wb_sel_i
add wave -noupdate /main/DUT/wb_adr_i
add wave -noupdate /main/DUT/wb_dat_i
add wave -noupdate /main/DUT/wb_dat_o
add wave -noupdate /main/DUT/wb_ack_o
add wave -noupdate /main/DUT/wb_stall_o
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {90685000000 fs} 0}
configure wave -namecolwidth 150
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {90556826170 fs} {90813173830 fs}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment