verilator/test_regress/t/t_force_mid.cpp
Geza Lore cf111d2e1f
Do not create aliases for forced port signals (#5105)
+ don't remove forced signals in V3Const and Dfg

Fixes #5062
2024-05-10 18:19:51 +01:00

47 lines
1.4 KiB
C++

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2024 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
// Test defines
#define MAIN_TIME_MULTIPLIER 1
#include <memory>
// OS header
#include "verilatedos.h"
// Generated header
#include "Vt_force_mid.h"
// General headers
#include "verilated.h"
std::unique_ptr<Vt_force_mid> topp;
int main(int argc, char** argv) {
uint64_t sim_time = 1100;
const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext};
contextp->commandArgs(argc, argv);
contextp->debug(0);
srand48(5);
topp.reset(new Vt_force_mid{"top"});
topp->topin = 0x9;
topp->eval();
{
topp->clk = false;
contextp->timeInc(10 * MAIN_TIME_MULTIPLIER);
}
while ((contextp->time() < sim_time * MAIN_TIME_MULTIPLIER) && !contextp->gotFinish()) {
topp->clk = !topp->clk;
topp->eval();
contextp->timeInc(1 * MAIN_TIME_MULTIPLIER);
contextp->timeInc(1 * MAIN_TIME_MULTIPLIER);
contextp->timeInc(1 * MAIN_TIME_MULTIPLIER);
contextp->timeInc(1 * MAIN_TIME_MULTIPLIER);
contextp->timeInc(1 * MAIN_TIME_MULTIPLIER);
}
if (!contextp->gotFinish()) {
vl_fatal(__FILE__, __LINE__, "main", "%Error: Timeout; never got a $finish");
}
topp->final();
topp.reset();
return 0;
}