1 // -*- mode: C++; c-file-style: "cc-mode" -*- 2 // 3 // DESCRIPTION: Verilator: Verilog Test module 4 // 5 // This file ONLY is placed under the Creative Commons Public Domain, for 6 // any use, without warranty, 2006 by Wilson Snyder. 7 // SPDX-License-Identifier: CC0-1.0 8 9 #include <verilated.h> 10 #include "Vt_func_rand.h" 11 sc_time_stamp()12double sc_time_stamp() { return 0; } 13 main(int argc,char * argv[])14int main(int argc, char* argv[]) { 15 Vt_func_rand* topp = new Vt_func_rand; 16 17 Verilated::debug(0); 18 19 printf("\nTesting\n"); 20 for (int i = 0; i < 10; i++) { 21 topp->clk = 0; 22 topp->eval(); 23 topp->clk = 1; 24 topp->eval(); 25 } 26 if (topp->Rand != 0xfeed0fad) { 27 vl_fatal(__FILE__, __LINE__, "top", "Unexpected value for Rand output\n"); 28 } 29 topp->final(); 30 VL_DO_DANGLING(delete topp, topp); 31 printf("*-* All Finished *-*\n"); 32 } 33