RegisterLogin  
Update Profile
   
You are here: Forum  
Minimize 
SVUG Community Forum
Subject: No Variables as bit vector indices?
Prev Next
You are not authorized to post a reply.

Author Messages
GregUser is Offline

Posts:11

06/26/2008 1:25 PM  

I have a packed struct that maps all the output pins of a block.

typedef struct packed {

bit⏋:0] data_bus;

bit error;

bit Ε:0] status;

} output_example_S;

data_output output_example_S;

data_output⏔:0] is a legal way to reference the structure.

I can assign data_bus = data_output.data_bus;

I want to overlay the array into the output_example_S structure.

The only way I can do this is map the array elements into the correct bit vector of the data_output in 32 bit increments.

bit ⎫:0] data_o⎠]

data_output⎫:0] = data_oΎ]

data_output⏋:32]=data_oΏ]

I want to use a method that increments the bit vector by 32 like

data_output [x:y] = data_o,

x +=32;

y+= 32;

i++;

 

The compile doesn't like the index of the bit vector to be variables.

 

The question is have you ever overlayed an array into a bit vector?

ShalomUser is Offline

Posts:10

06/26/2008 9:58 PM  
Your struct variable should be declared as

output_example_S data_output;

instead of

data_output output_example_S;

Shalom
ShalomUser is Offline

Posts:10

06/27/2008 12:52 AM  
Instead of data_output [x:y], data_output [x-:32].

Shalom
You are not authorized to post a reply.
Forums > General Discussion > Main Discussion Area > No Variables as bit vector indices?



ActiveForums 3.7
  

 Copyright 2007 by SystemVerilog User Group Contact Us    Privacy Statement