From 68083e9e02744022631d5b77e119f8d0fcb306b8 Mon Sep 17 00:00:00 2001 From: Brian Woods Date: Wed, 12 Apr 2023 12:55:22 -0400 Subject: mixed_hdl: add init files This isn't fully mixed but rather it supports VHDL modiles in a verilog simulation. You can't have verilog undernearth the VHDL either. It uses the ghdl (v3 or higher) synth option to synth the VHDL top modules to verilog and then it uses those with Icarus. --- mixed_hdl/counter.v | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 mixed_hdl/counter.v (limited to 'mixed_hdl/counter.v') diff --git a/mixed_hdl/counter.v b/mixed_hdl/counter.v new file mode 100644 index 0000000..23ab9f2 --- /dev/null +++ b/mixed_hdl/counter.v @@ -0,0 +1,23 @@ +module counter(count, dr, en, rst, clk); + + parameter WIDTH = 8; + + output [WIDTH-1: 0] count; + output dr; + input en, rst, clk; + + reg [WIDTH-1: 0] count; + wire en, rst, clk; + reg dr; + + always @(posedge clk or posedge rst) + begin + if (rst) + count <= 0; + else + dr <= en; + if (en) + count <= count + 1; + end + +endmodule // counter -- cgit v1.2.3