[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  SystemPerl
  Voneline
  WFH
General Info
  Papers

Issue #355

Support '{...}

Added by Alex Solomatnikov about 2 years ago. Updated 9 months ago.

Status:Feature Start date:05/20/2011
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Unsupported
Target version:-

Description

It turns out that the correct version of RTL from bug354 requires '{...} which is not supported by Verilator (other simulation and synthesis tools support it):

module_name inst_name
    ( .id_out('{id0, id1}),
      .* );

%Error: ..._control.v:422: syntax error, unexpected "'{", expecting TYPE-IDENTIFIER

Here is an example from IEEE 1800-2005 doc:

Array literals are syntactically similar to C initializers, but with the replicate operator ({{}} ) allowed.

int n[1:2][1:3] = '{'{0,1,2},'{3{4}}};

t_assignment_pattern.v (4.2 kB) Iztok Jeras, 05/11/2012 04:21 pm

History

Updated by Wilson Snyder about 2 years ago

  • Category set to Unsupported
  • Status changed from New to Feature

'{ is a system verilog feature I thought wouldn't really be needed until structures were supported, but I see how this can be useful. I'll look at adding it.

Meanwhile you can just

assign temp_array[0] = id0;
assign temp_array[1] = id1;

Updated by Alex Solomatnikov almost 2 years ago

Yes, there is an obvious workaround. However, it requires a lot of meaningless extra code: I added 30 lines just because of 1 instantiation, which itself requires only 11 lines.

Updated by Wilson Snyder over 1 year ago

See bug424 for the parameter need for this.

Updated by Alex Solomatnikov about 1 year ago

Another example:

integer scan_offsets[0:3] = '{ 0, MEM_IF_READ_DQS_WIDTH + MEM_DQ_PER_DQS, MEM_IF_READ_DQS_WIDTH, MEM_IF_READ_DQS_WIDTH + MEM_DQ_PER_DQS + 1 };

Updated by Iztok Jeras about 1 year ago

Hi,

This feature is now called "Assignment patterns". In addition to arrays and structures it can be used on 1D vectors.

The next example can be used to test the the feature applied to 1D vectors: test_regress/t/t_assignment_pattern.v the test can be found at (branch test_sv): https://github.com/jeras/verilator

Regards, Iztok Jeras

Updated by Wilson Snyder 9 months ago

The structure version of '{} is in git towards 3.841. Hope to get to array '{} shortly.

Also available in: Atom