From a00343ed9163267dab8f3c87f7f05671aa2f9e76 Mon Sep 17 00:00:00 2001 From: cspark Date: Sat, 15 Nov 2025 12:16:43 +0000 Subject: [PATCH] Init --- .gitignore | 2 ++ overture.sv | 14 ++++++++++++++ overture_tb.sv | 22 ++++++++++++++++++++++ run.sh | 13 +++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 .gitignore create mode 100644 overture.sv create mode 100644 overture_tb.sv create mode 100755 run.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0fb8788 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +obj_dir/ +*.vcd diff --git a/overture.sv b/overture.sv new file mode 100644 index 0000000..81e82e3 --- /dev/null +++ b/overture.sv @@ -0,0 +1,14 @@ +module overture( + in, + out + ); + + input [7:0] in; + output reg [7:0] out; + + always@(*) begin + foreach (input[i]) begin + out[i] = !in[i] + end + end +endmodule diff --git a/overture_tb.sv b/overture_tb.sv new file mode 100644 index 0000000..66691e4 --- /dev/null +++ b/overture_tb.sv @@ -0,0 +1,22 @@ +module overture_tb; + reg [7:0] in; + reg [7:0] out; + overture dut(in, out); + + initial begin + $dumpfile("overture_dump.vcd"); + $dumpvars(); + in = 8'b00000001; + out = 8'b00000000; + + #10; + + #10; + in = 8'b11111111; + #10; + in = 8'b00000001; + #10; + + $finish; + end +endmodule diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..d0e6b30 --- /dev/null +++ b/run.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Compile simulation and dump with timing for waveform analysis +verilator --binary overture.sv overture_tb.sv --top overture_tb --trace-vcd --timing + +# Run compiled simulation +./obj_dir/Voverture_tb + +# Close old session +pkill gtkwave + +# Launch new session +gtkwave overture_dump.vcd &