> sim RTL
ysyx_22040000 李心杨 Linux calcite 6.1.65 #1-NixOS SMP PREEMPT_DYNAMIC Sun Dec 3 06:32:13 UTC 2023 x86_64 GNU/Linux 18:31:48 up 21:29, 2 users, load average: 1.18, 0.83, 0.63
This commit is contained in:
parent
b66f0c6d56
commit
df992995ca
11 changed files with 224 additions and 16 deletions
|
@ -1,11 +1,21 @@
|
|||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include "Vexample.h"
|
||||
#include "verilated.h"
|
||||
|
||||
int main(int argc, char **argv, char **env) {
|
||||
Verilated::commandArgs(argc, argv);
|
||||
Vexample *top = new Vexample;
|
||||
while (!Verilated::gotFinish()) {
|
||||
int round = 100;
|
||||
while (round--) {
|
||||
int a = rand() & 1;
|
||||
int b = rand() & 1;
|
||||
top->a = a;
|
||||
top->b = b;
|
||||
top->eval();
|
||||
printf("a = %d, b = %d, f = %d\n", a, b, top->f);
|
||||
assert(top->f == (a ^ b));
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue