Skip to content

Commit

Permalink
Multi bit testing infrastructure works
Browse files Browse the repository at this point in the history
  • Loading branch information
RCoeurjoly committed May 28, 2024
1 parent 4f007a2 commit f9e7cc8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/functional/multi_bit/vcd_harness.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <iostream>
#include <fstream>
#include <random>
#include <bitset>

#include "my_module_functional_cxx.cc"

Expand Down Expand Up @@ -74,16 +75,16 @@ int main(int argc, char **argv)

std::random_device rd;
std::mt19937 gen(rd());
std::bernoulli_distribution dist(0.5);
std::uniform_int_distribution<int> dist(0, 255);

for (int step = 0; step < steps; ++step) {
const bool a_value = dist(gen);
const bool b_value = dist(gen);
const uint8_t a_value = dist(gen);
const uint8_t b_value = dist(gen);

// Functional backend cxx
vcd_file << "#" << (step + 1) << "\n";
inputs.a = $const<1>(a_value);
inputs.b = $const<1>(b_value);
inputs.a = $const<8>(a_value);
inputs.b = $const<8>(b_value);

my_module(inputs, outputs, state, next_state);
{
Expand Down

0 comments on commit f9e7cc8

Please sign in to comment.