From 37b813a015eb8d75b00136744a5ecdb47d29c848 Mon Sep 17 00:00:00 2001 From: saji Date: Thu, 23 May 2024 11:57:50 -0500 Subject: [PATCH] cleanup, use checks instead of requires --- sim/src/main.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/sim/src/main.cpp b/sim/src/main.cpp index 0bb2003..3fda243 100644 --- a/sim/src/main.cpp +++ b/sim/src/main.cpp @@ -15,17 +15,18 @@ TEST_CASE("HUB75E Driver Test") { }; fixture.set_done_callback(done_check); const Vhub75e &dut = fixture.get(); + // stimulus to start the transaction. auto stim = std::make_shared(dut.write_trig, 4); - fixture.set_timeout(250000); - fixture.add_module(stim); + fixture.set_timeout(250000); + auto bram = std::make_shared(1, dut.clk, dut.pixbuf_addr, + dut.pixbuf_data); + fixture.add_module(bram); + auto display = std::make_shared(128, 64, dut); + fixture.add_module(display); + SECTION("Smoke Tests") { - auto bram = std::make_shared(1, dut.clk, dut.pixbuf_addr, - dut.pixbuf_data); - fixture.add_module(bram); - auto display = std::make_shared(128, 64, dut); - fixture.add_module(display); fixture.exec(); @@ -58,14 +59,9 @@ TEST_CASE("HUB75E Driver Test") { // this is the part where we validate that the line in = line out. // we have to generate different values since the fixture.enable_trace("testing.vcd"); - auto line = GENERATE(take(10, chunk(512, random(0, 0xFFFFFF)))); - auto bram = std::make_shared(1, dut.clk, dut.pixbuf_addr, - dut.pixbuf_data); - + // generate an entire block of RAM + auto line = GENERATE(take(1, chunk(512, random(0, 0xFFFFFF)))); std::copy(line.begin(), line.end(), bram->get().begin()); - fixture.add_module(bram); - auto display = std::make_shared(128, 64, dut); - fixture.add_module(display); fixture.exec(); @@ -80,9 +76,9 @@ TEST_CASE("HUB75E Driver Test") { for (int i = 0; i < 128; i++) { CAPTURE(i); CAPTURE(ram_ref[i], row0[i]); - REQUIRE(ram_ref[i] == row0[i]); + CHECK(ram_ref[i] == row0[i]); CAPTURE(ram_ref[i+256], row1[i]); - REQUIRE(ram_ref[i+256] == row1[i]); + CHECK(ram_ref[i+256] == row1[i]); } // CHECK(std::equal(ram_ref.begin(), ram_ref.begin() + 128, row0.begin(),