Skip to content

Instantly share code, notes, and snippets.

@yodalee
Created January 30, 2023 15:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Verilator cmake does not generate right configuration with system-verilog package
cmake_minimum_required(VERSION 3.16)
project(verilog)
find_package(verilator HINTS $ENV{VERILATOR_ROOT})
set(OUT Vmain)
add_executable(${OUT} main.cpp)
verilate(${OUT} TRACE_FST SOURCES out.sv pkg.sv)
#include "Vout.h"
#include <memory>
int main(int argc, char **argv) {
std::unique_ptr<Vout> top{new Vout("top")};
return 0;
}
import pkg::*;
module our (
input clk,
output qbit out
);
always @(posedge clk) begin
begin $display("Hello World"); $finish; end
end
endmodule
package pkg;
typedef logic [4:0] qbit;
endpackage
@codelec
Copy link

codelec commented Feb 1, 2023

cmake_minimum_required(VERSION 3.16)

project(verilog)

find_package(verilator HINTS $ENV{VERILATOR_ROOT})

set(OUT Vmain)

add_executable(${OUT} main.cpp)
verilate(${OUT} TRACE_FST PREFIX Vout SOURCES pkg.sv out.sv)

@yodalee
Copy link
Author

yodalee commented Feb 1, 2023

Yes this works, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment