The Designer's Guide Community
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 22nd, 2024, 4:01pm
Pages: 1
Send Topic Print
[Need help] Concatenate integer arrays (Read 225 times)
Junior Member

Posts: 19
Chelsmford, MA
[Need help] Concatenate integer arrays
Jul 18th, 2023, 8:02pm

I'm trying to concatenate two integer arrays in a verilog-A code. My code is as follows:

`include "constants.vams"
`include "disciplines.vams"

module scratch (out);

output out;
electrical out;

integer a[2:0] = {1,2,3}, b[3:0] = {1,2,3,4};
integer c[7:0], k;

analog begin

c = {a,b};

for (k=0; k<3; k=k+1) begin
     $strobe("a[%d] = %d", k, a[k]);
     $strobe("b[%d] = %d", k, b[k]);
     $strobe("c[%d] = %d", k, c[k]);

V(out) <+ 0;



But I get the following error - " The target of the assignment is a vector. Specify a scalar as the target of the assignment."

Could anyone please help me understand this or show me how to fix it?

Back to top

View Profile Shahriar   IP Logged
Senior Fellow

Posts: 1999
Massachusetts, USA
Re: [Need help] Concatenate integer arrays
Reply #1 - Aug 30th, 2023, 5:57pm
I think this may not be supported by the language. In the VAMS LRM, section 5.7, it says,
Concatenation expressions cannot be used as part of the analog_expression (assigning to list of values in the analog context is not allowed).
Back to top

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to Consider submitting a paper or model.