mirror of
https://github.com/verilator/verilator.git
synced 2025-07-31 07:56:10 +00:00
Fix --public-flat-rw / DPI issue (#2858)
This commit is contained in:
parent
4e41c13501
commit
87728a9ee3
@ -330,7 +330,8 @@ class EmitCSyms final : EmitCBaseVisitor {
|
||||
virtual void visit(AstVar* nodep) override {
|
||||
nameCheck(nodep);
|
||||
iterateChildren(nodep);
|
||||
if (nodep->isSigUserRdPublic()) m_modVars.emplace_back(std::make_pair(m_modp, nodep));
|
||||
if (nodep->isSigUserRdPublic() && !m_cfuncp)
|
||||
m_modVars.emplace_back(std::make_pair(m_modp, nodep));
|
||||
}
|
||||
virtual void visit(AstCoverDecl* nodep) override {
|
||||
// Assign numbers to all bins, so we know how big of an array to use
|
||||
|
@ -202,6 +202,8 @@ int mon_check() {
|
||||
return 0; // Ok
|
||||
}
|
||||
|
||||
void dpi_print(const char* somestring) { printf("SOMESTRING = %s\n", somestring); }
|
||||
|
||||
//======================================================================
|
||||
|
||||
#ifdef IS_VPI
|
||||
|
@ -12,6 +12,8 @@
|
||||
import "DPI-C" context function int mon_check();
|
||||
`endif
|
||||
|
||||
import "DPI-C" function void dpi_print(input string somestring);
|
||||
|
||||
`ifdef VERILATOR_COMMENTS
|
||||
`define PUBLIC_FLAT_RD /*verilator public_flat_rd*/
|
||||
`define PUBLIC_FLAT_RW /*verilator public_flat_rw @(posedge clk)*/
|
||||
@ -54,6 +56,7 @@ extern "C" int mon_check();
|
||||
|
||||
// Test loop
|
||||
initial begin
|
||||
dpi_print("foo");
|
||||
`ifdef VERILATOR
|
||||
status = $c32("mon_check()");
|
||||
`endif
|
||||
|
Loading…
Reference in New Issue
Block a user