Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple instance in a single module instantiation #884

Closed
veripoolbot opened this issue Feb 19, 2015 · 5 comments
Closed

Multiple instance in a single module instantiation #884

veripoolbot opened this issue Feb 19, 2015 · 5 comments
Assignees
Labels
resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Franck Jullien (@fjullien)
Original Redmine Issue: 884 from https://www.veripool.org
Original Date: 2015-02-19
Original Assignee: Wilson Snyder (@wsnyder)


The verilog standard says that "One or more module instances (identical copies of a module) can be specified in a single module instantiation statement.".
So we can have for example:

  fifo4 #(8)
  rfifo(
	.clk   ( clk_i   ),
	.rst   ( ~rst_i  ),
	.clr   ( ~spe    ),
	.din   ( treg    ),
	.we    ( rfwe    ),
	.dout  ( rfdout  ),
	.re    ( rfre    ),
	.full  ( rffull  ),
	.empty ( rfempty )
  ),
  wfifo(
	.clk   ( clk_i   ),
	.rst   ( ~rst_i  ),
	.clr   ( ~spe    ),
	.din   ( dat_i   ),
	.we    ( wfwe    ),
	.dout  ( wfdout  ),
	.re    ( wfre    ),
	.full  ( wffull  ),
	.empty ( wfempty )
  );

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Franck Jullien (@fjullien)
Original Date: 2015-02-19T08:06:23Z


However, verilator doesn't handle this syntax. With such a code, I get a segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000478612 in AstNode::iterateAndNext(AstNVisitor&, AstNUser*) ()
(gdb) bt
#0  0x0000000000478612 in AstNode::iterateAndNext(AstNVisitor&, AstNUser*) ()
#1  0x00000000004786e5 in AstNode::iterateChildren(AstNVisitor&, AstNUser*) ()
#2  0x00000000005bb735 in LinkDotFindVisitor::visit(AstNode*, AstNUser*) ()
#3  0x00000000004676d1 in AstNVisitor::visit(AstPin*, AstNUser*) ()
#4  0x0000000000488468 in AstPin::accept(AstNVisitor&, AstNUser*) ()
#5  0x0000000000478639 in AstNode::iterateAndNext(AstNVisitor&, AstNUser*) ()
#6  0x00000000004786f9 in AstNode::iterateChildren(AstNVisitor&, AstNUser*) ()
#7  0x00000000005cb0aa in LinkDotFindVisitor::visit(AstCell*, AstNUser*) ()
#8  0x00000000004884f0 in AstCell::accept(AstNVisitor&, AstNUser*) ()
#9  0x0000000000478639 in AstNode::iterateAndNext(AstNVisitor&, AstNUser*) ()
#10 0x00000000004786f9 in AstNode::iterateChildren(AstNVisitor&, AstNUser*) ()
#11 0x00000000005c81ec in LinkDotFindVisitor::visit(AstNodeModule*, AstNUser*) ()
#12 0x0000000000467371 in AstNVisitor::visit(AstModule*, AstNUser*) ()
#13 0x000000000041fc08 in AstModule::accept(AstNVisitor&, AstNUser*) ()
#14 0x00000000005cb946 in LinkDotFindVisitor::visit(AstCell*, AstNUser*) ()
#15 0x00000000004884f0 in AstCell::accept(AstNVisitor&, AstNUser*) ()
#16 0x0000000000478639 in AstNode::iterateAndNext(AstNVisitor&, AstNUser*) ()
#17 0x00000000004786f9 in AstNode::iterateChildren(AstNVisitor&, AstNUser*) ()
#18 0x00000000005c81ec in LinkDotFindVisitor::visit(AstNodeModule*, AstNUser*) ()
#19 0x0000000000467371 in AstNVisitor::visit(AstModule*, AstNUser*) ()
#20 0x000000000041fc08 in AstModule::accept(AstNVisitor&, AstNUser*) ()
#21 0x00000000005caebf in LinkDotFindVisitor::visit(AstNetlist*, AstNUser*) ()
#22 0x000000000046598c in AstNetlist::accept(AstNVisitor&, AstNUser*) ()
#23 0x00000000005baa35 in V3LinkDot::linkDotGuts(AstNetlist*, VLinkDotStep) ()
#24 0x00000000004600ed in process() ()
#25 0x00000000004651a0 in main ()
(gdb)

Franck.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-02-22T16:29:35Z


Comma separated instantiations are split into two in the parser, so should not directly lead to this error, and simple tests with commas work.

Can you please submit a complete example in test_regress format (see docs) that passes on another simulator? Thanks

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-02-22T16:42:38Z


Ah, I realized a difference was you had parameters. When I added that to the test I got a crash in the parser. However I did not see nor can explain why the crash you saw would be in that part of the program.

Anyhow the problem I saw is fixed in git, please try it and confirm this fixes your issue.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Franck Jullien (@fjullien)
Original Date: 2015-02-23T10:30:01Z


You fixed it ! Thanks.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-04-05T15:00:42Z


In 3.872.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants