Created
January 30, 2023 15:29
-
-
Save yodalee/a30e14f86c2601fcfaaa079a6e70cfb8 to your computer and use it in GitHub Desktop.
Verilator cmake does not generate right configuration with system-verilog package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Vout.h" | |
#include <memory> | |
int main(int argc, char **argv) { | |
std::unique_ptr<Vout> top{new Vout("top")}; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pkg::*; | |
module our ( | |
input clk, | |
output qbit out | |
); | |
always @(posedge clk) begin | |
begin $display("Hello World"); $finish; end | |
end | |
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pkg; | |
typedef logic [4:0] qbit; | |
endpackage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment