> 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 19:57:04 up 22:55, 2 users, load average: 0.71, 0.62, 0.53
This commit is contained in:
parent
3b0310ef47
commit
8b71fb7db5
1 changed files with 9 additions and 3 deletions
|
@ -1,13 +1,17 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <verilated.h>
|
||||||
|
#include <verilated_vcd_c.h>
|
||||||
#include "Vexample.h"
|
#include "Vexample.h"
|
||||||
#include "verilated.h"
|
|
||||||
|
|
||||||
int main(int argc, char **argv, char **env) {
|
int main(int argc, char **argv, char **env) {
|
||||||
|
int round = 100;
|
||||||
Verilated::commandArgs(argc, argv);
|
Verilated::commandArgs(argc, argv);
|
||||||
Vexample *top = new Vexample;
|
Vexample *top = new Vexample;
|
||||||
int round = 100;
|
VerilatedVcdC *m_trace = new VerilatedVcdC;
|
||||||
|
top->trace(m_trace, 5);
|
||||||
|
m_trace->open("waveform.vcd");
|
||||||
while (round--) {
|
while (round--) {
|
||||||
int a = rand() & 1;
|
int a = rand() & 1;
|
||||||
int b = rand() & 1;
|
int b = rand() & 1;
|
||||||
|
@ -17,5 +21,7 @@ int main(int argc, char **argv, char **env) {
|
||||||
printf("a = %d, b = %d, f = %d\n", a, b, top->f);
|
printf("a = %d, b = %d, f = %d\n", a, b, top->f);
|
||||||
assert(top->f == (a ^ b));
|
assert(top->f == (a ^ b));
|
||||||
}
|
}
|
||||||
exit(0);
|
m_trace->close();
|
||||||
|
delete top;
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue