aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/xilinx7/counter_tb.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-08-22 20:26:19 +0200
committerClifford Wolf <clifford@clifford.at>2013-08-22 20:31:04 +0200
commit5059b3166098044a87b3d0b7f3ae2957df7e6194 (patch)
tree56354acd86f6a874e9054774587907ee8e7f3754 /techlibs/xilinx7/counter_tb.v
parent39ee561169ba04374c2c630a5ef5a61537a67c13 (diff)
downloadyosys-5059b3166098044a87b3d0b7f3ae2957df7e6194.tar.gz
yosys-5059b3166098044a87b3d0b7f3ae2957df7e6194.tar.bz2
yosys-5059b3166098044a87b3d0b7f3ae2957df7e6194.zip
Added simple xilinx7 technology mapping files
Diffstat (limited to 'techlibs/xilinx7/counter_tb.v')
-rw-r--r--techlibs/xilinx7/counter_tb.v61
1 files changed, 61 insertions, 0 deletions
diff --git a/techlibs/xilinx7/counter_tb.v b/techlibs/xilinx7/counter_tb.v
new file mode 100644
index 000000000..b6b64269e
--- /dev/null
+++ b/techlibs/xilinx7/counter_tb.v
@@ -0,0 +1,61 @@
+`timescale 1 ns / 1 ps
+
+module testbench;
+
+reg clk, en, rst;
+wire [3:0] count;
+
+counter uut_counter(
+ .clk(clk),
+ .count(count),
+ .en(en),
+ .rst(rst)
+);
+
+initial begin
+ clk <= 0;
+ forever begin
+ #50;
+ clk <= ~clk;
+ end
+end
+
+initial begin
+ @(posedge clk);
+ forever begin
+ @(posedge clk);
+ $display("%d", count);
+ end
+end
+
+initial begin
+ rst <= 1; en <= 0; @(posedge clk);
+ rst <= 1; en <= 0; @(posedge clk);
+ rst <= 0; en <= 0; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 0; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 1; en <= 1; @(posedge clk);
+ rst <= 0; en <= 0; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 0; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 0; @(posedge clk);
+ rst <= 1; en <= 0; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 0; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 0; @(posedge clk);
+ rst <= 0; en <= 1; @(posedge clk);
+ rst <= 0; en <= 0; @(posedge clk);
+ $finish;
+end
+
+endmodule