[Downgrade] downgrade example file to 4.0 ver.
This commit is contained in:
@@ -7,6 +7,9 @@ if(NOT DEFINED VERILATOR_ROOT)
|
|||||||
set(ENV{VERILATOR_ROOT} "/home/blur/gits/verilator")
|
set(ENV{VERILATOR_ROOT} "/home/blur/gits/verilator")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# 设置 Verilator 头文件目录
|
||||||
|
include_directories($ENV{VERILATOR_ROOT}/include)
|
||||||
|
|
||||||
# 设置编译器参数
|
# 设置编译器参数
|
||||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||||
message("Turn On Debugger")
|
message("Turn On Debugger")
|
||||||
@@ -52,8 +55,6 @@ set(LACPU lacpu)
|
|||||||
set(LAVSIM lavsim)
|
set(LAVSIM lavsim)
|
||||||
set(LA_VSIM_TARGET ${PROJECT_NAME}-vsim)
|
set(LA_VSIM_TARGET ${PROJECT_NAME}-vsim)
|
||||||
|
|
||||||
include_directories(${verilator_DIR}/include)
|
|
||||||
|
|
||||||
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
|
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
|
||||||
|
|
||||||
if (NOT verilator_FOUND)
|
if (NOT verilator_FOUND)
|
||||||
|
|||||||
@@ -18,18 +18,15 @@ int main(int argc, char** argv) {
|
|||||||
// real project, it is better to start with a more complete example,
|
// real project, it is better to start with a more complete example,
|
||||||
// e.g. examples/c_tracing.
|
// e.g. examples/c_tracing.
|
||||||
|
|
||||||
// Construct a VerilatedContext to hold simulation time, etc.
|
|
||||||
VerilatedContext* contextp = new VerilatedContext;
|
|
||||||
|
|
||||||
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
|
// Pass arguments so Verilated code can see them, e.g. $value$plusargs
|
||||||
// This needs to be called before you create any model
|
// This needs to be called before you create any model
|
||||||
contextp->commandArgs(argc, argv);
|
Verilated::commandArgs(argc, argv);
|
||||||
|
|
||||||
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
|
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
|
||||||
Vtop* top = new Vtop{contextp};
|
Vtop* top = new Vtop();
|
||||||
|
|
||||||
// Simulate until $finish
|
// Simulate until $finish
|
||||||
while (!contextp->gotFinish()) {
|
while (!Verilated::gotFinish()) {
|
||||||
|
|
||||||
// Evaluate model
|
// Evaluate model
|
||||||
top->eval();
|
top->eval();
|
||||||
|
|||||||
Reference in New Issue
Block a user