forked from github/verilator
Fix -G dropping public indication (#2561).
This commit is contained in:
parent
157948c552
commit
7a9e79ea79
2
Changes
2
Changes
@ -9,6 +9,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
|||||||
|
|
||||||
**** Support # as a comment in -f files (#2497). [phantom-killua]
|
**** Support # as a comment in -f files (#2497). [phantom-killua]
|
||||||
|
|
||||||
|
**** Fix -G dropping public indication (#2561). [Andrew Goessling]
|
||||||
|
|
||||||
|
|
||||||
* Verilator 4.100 2020-09-07
|
* Verilator 4.100 2020-09-07
|
||||||
|
|
||||||
|
@ -1128,6 +1128,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||||||
AstVar* newp
|
AstVar* newp
|
||||||
= new AstVar(nodep->fileline(), AstVarType(AstVarType::GPARAM),
|
= new AstVar(nodep->fileline(), AstVarType(AstVarType::GPARAM),
|
||||||
nodep->name(), nodep);
|
nodep->name(), nodep);
|
||||||
|
newp->combineType(nodep);
|
||||||
string svalue = v3Global.opt.parameter(nodep->name());
|
string svalue = v3Global.opt.parameter(nodep->name());
|
||||||
if (AstNode* valuep
|
if (AstNode* valuep
|
||||||
= AstConst::parseParamLiteral(nodep->fileline(), svalue)) {
|
= AstConst::parseParamLiteral(nodep->fileline(), svalue)) {
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "Vt_param_public.h"
|
#include "Vt_param_public.h"
|
||||||
|
|
||||||
#include "Vt_param_public_p.h"
|
#include "Vt_param_public_p.h"
|
||||||
|
#include "Vt_param_public_t.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
Vt_param_public* topp = new Vt_param_public;
|
Vt_param_public* topp = new Vt_param_public;
|
||||||
@ -17,6 +18,9 @@ int main(int argc, char* argv[]) {
|
|||||||
Verilated::debug(0);
|
Verilated::debug(0);
|
||||||
|
|
||||||
// Make sure public tag worked
|
// Make sure public tag worked
|
||||||
|
if (static_cast<int>(Vt_param_public_t::TOP_PARAM) != 30) {
|
||||||
|
vl_fatal(__FILE__, __LINE__, "dut", "bad value");
|
||||||
|
}
|
||||||
if (static_cast<int>(Vt_param_public_p::INPACK) != 0) {}
|
if (static_cast<int>(Vt_param_public_p::INPACK) != 0) {}
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
|
@ -12,7 +12,7 @@ scenarios(simulator => 1);
|
|||||||
|
|
||||||
if ($Self->{vlt_all}) {
|
if ($Self->{vlt_all}) {
|
||||||
compile(
|
compile(
|
||||||
verilator_flags2 => ["--exe $Self->{t_dir}/$Self->{name}.cpp"],
|
verilator_flags2 => ["-GTOP_PARAM=30 --exe $Self->{t_dir}/$Self->{name}.cpp"],
|
||||||
make_top_shell => 0,
|
make_top_shell => 0,
|
||||||
make_main => 0,
|
make_main => 0,
|
||||||
);
|
);
|
||||||
|
@ -12,6 +12,8 @@ module t (/*AUTOARG*/
|
|||||||
);
|
);
|
||||||
input clk;
|
input clk;
|
||||||
|
|
||||||
|
parameter TOP_PARAM /*verilator public*/ = 20;
|
||||||
|
|
||||||
a #(1) a1 ();
|
a #(1) a1 ();
|
||||||
b #(2) b2 ();
|
b #(2) b2 ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user