The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Oct 4th, 2023, 6:18am
Pages: 1
Send Topic Print
[Need help] Concatenate integer arrays (Read 97 times)
Shahriar
Junior Member
**
Offline



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

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]);
end

V(out) <+ 0;

end

endmodule

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?

Thanks.
Back to top
 
 

Shahriar
View Profile Shahriar   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
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-2023 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 editor@designers-guide.org. Consider submitting a paper or model.