FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal


Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-10-2005, 09:46 PM
Chris Briggs
Posts: n/a
Default using array ports in SV

I have a SystemVerilog question. The LRM says a module port can be an
array, but I can't figure out the syntax to connect to it in the


module foo;
wire [7:0] dat0;
wire [7:0] dat1;

bar bar0(.baz ({dat1, dat0}));
endmodule // foo

module bar(input wire [7:0] baz [2]);

endmodule // bar

When I run that through Questa, I get an error:
# ** Error: (vsim-3843) array_in.sv(5): Illegal packed type to unpacked
type connection for port 'baz'.

I've tried several variations on that but haven't gotten it right. How
are you supposed to connect different signals to elements of an input
array? Do I have to put them in an array first?



Reply With Quote
  #2 (permalink)  
Old 11-11-2005, 01:35 AM
Posts: n/a
Default Re: using array ports in SV

The problem is that your {dat1, dat0} is being treated as a
concatenation. The Accellera standard had a problem that the syntax
for constructing an array was ambiguous with the existing Verilog
syntax for concatenation. The (just approved) IEEE standard fixed this
by changing the syntax for constructing an array or structure value.
Your tool might accept that new syntax.

The fully qualified syntax preceeds the curly braces with a type
qualifier, datatype', where datatype is the name of the array or
structure type. For cases like this one, where the type can be
determined from the type on the other side of the port, you can leave
the datatype off. So the short-hand syntax is '{dat1, dat0}. The '
character still indicates that this is not an ordinary concatenation.

Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SV: Can I have array of Queues? Ravi S Gowda Verilog 1 09-01-2005 06:59 AM
How to vary the number and width of ports? Steven Alexander Verilog 3 05-14-2004 02:33 PM
How to define reg ports? Chris Carlen Verilog 9 03-01-2004 07:17 PM
inout ports? CupOfWater Verilog 2 10-10-2003 09:32 AM
Question about Assignment of a one-dimensional array to a two-dimensional array Andres Vazquez Verilog 1 08-26-2003 12:18 AM

All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved