aboutsummaryrefslogtreecommitdiffstats
path: root/tb
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@leaflabs.com>2013-10-08 22:05:21 -0400
committerbryan newbold <bnewbold@leaflabs.com>2013-10-08 22:05:21 -0400
commitb31c07157b7b8ca7e8823749e140fcab24b787d2 (patch)
treef03d74eb53c316d0ef30962c39f447434432ce45 /tb
parent06bb61d1163f3cac14a6a4b26dd64f3cfb105c97 (diff)
downloadbasic-hdl-template-b31c07157b7b8ca7e8823749e140fcab24b787d2.tar.gz
basic-hdl-template-b31c07157b7b8ca7e8823749e140fcab24b787d2.zip
working xula2 sim/syn/prog system
Diffstat (limited to 'tb')
-rwxr-xr-xtb/xula2_tb.v43
-rw-r--r--tb/xula2_tb.wcfg30
2 files changed, 73 insertions, 0 deletions
diff --git a/tb/xula2_tb.v b/tb/xula2_tb.v
new file mode 100755
index 0000000..6fd8316
--- /dev/null
+++ b/tb/xula2_tb.v
@@ -0,0 +1,43 @@
+`timescale 1ns/1ps
+module xula2_tb;
+
+reg synth_clk_12mhz;
+always @(synth_clk_12mhz) begin
+ #83333.33 synth_clk_12mhz <= ~synth_clk_12mhz;
+end
+
+initial begin
+ // the first event that sets the clock in motion
+ #0 synth_clk_12mhz <= 1'b0;
+end
+
+reg reset;
+wire led;
+wire [31:0] chan;
+assign chan[0] = reset;
+assign led = chan[10];
+
+main main_inst (
+ .clock_12mhz(synth_clk_12mhz),
+ .chan(chan),
+ .chan_clk(),
+ .microsd_cs(),
+ .flash_cs(),
+ .flash_sclk(),
+ .flash_mosi(),
+ .flash_miso()
+);
+
+
+initial begin
+ #0
+ reset <= 1'b1;
+ #1000000000 // 1 s delay
+ #1000000000 // 1 s delay
+ #1000000000 // 1 s delay
+ reset <= 1'b0;
+
+ $finish();
+end
+
+endmodule
diff --git a/tb/xula2_tb.wcfg b/tb/xula2_tb.wcfg
new file mode 100644
index 0000000..7a75798
--- /dev/null
+++ b/tb/xula2_tb.wcfg
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wave_config>
+ <wave_state>
+ </wave_state>
+ <db_ref_list>
+ <db_ref path="./isim.wdb" id="1" type="auto">
+ <top_modules>
+ <top_module name="glbl" />
+ <top_module name="xula2_tb" />
+ </top_modules>
+ </db_ref>
+ </db_ref_list>
+ <WVObjectSize size="4" />
+ <wvobject fp_name="/xula2_tb/synth_clk_12mhz" type="logic" db_ref_id="1">
+ <obj_property name="ElementShortName">synth_clk_12mhz</obj_property>
+ <obj_property name="ObjectShortName">synth_clk_12mhz</obj_property>
+ </wvobject>
+ <wvobject fp_name="/xula2_tb/chan" type="array" db_ref_id="1">
+ <obj_property name="ElementShortName">chan[31:0]</obj_property>
+ <obj_property name="ObjectShortName">chan[31:0]</obj_property>
+ </wvobject>
+ <wvobject fp_name="/xula2_tb/reset" type="logic" db_ref_id="1">
+ <obj_property name="ElementShortName">reset</obj_property>
+ <obj_property name="ObjectShortName">reset</obj_property>
+ </wvobject>
+ <wvobject fp_name="/xula2_tb/led" type="logic" db_ref_id="1">
+ <obj_property name="ElementShortName">led</obj_property>
+ <obj_property name="ObjectShortName">led</obj_property>
+ </wvobject>
+</wave_config>