epic testbenches

This commit is contained in:
Ben Kyd
2025-07-07 15:48:53 +01:00
parent cb009937d5
commit 8671169b26
5 changed files with 4993 additions and 33 deletions

2
.gitignore vendored
View File

@@ -4,3 +4,5 @@ build/
bin/
.obj_dir/
obj_dir/
.nvim/
.cache/

View File

@@ -13,7 +13,7 @@ int main(int argc, char** argv) {
tfp->open("wave.vcd");
int clk = 0;
for (int time = 0; time < 500; time++) {
for (int time = 0; time < 50000; time++) {
// Toggle clk every 20 time units (simulate 25 MHz)
if ((time % 20) == 0)
clk = !clk;

View File

@@ -1,6 +1,15 @@
module top (
input clk_25mhz,
output [3:0] led
output h_sync,
output v_sync,
output [3:0] r,
output [3:0] g,
output [3:0] b
);
assign led[0] = clk_25mhz;
endmodule

View File

@@ -1,13 +1,24 @@
// Copyright 2025 Benjamin Kyd, All Rights Reserved
`timescale 1ns / 1ps
module top_tb;
reg clk_25mhz = 0;
wire [3:0] led;
wire h_sync, v_sync;
wire [3:0] r;
wire [3:0] g;
wire [3:0] b;
top uut (
.clk_25mhz(clk_25mhz),
.led(led)
.h_sync(h_sync),
.v_sync(v_sync),
.r(r),
.g(g),
.b(b)
);
always #20 clk_25mhz = ~clk_25mhz;

File diff suppressed because it is too large Load Diff