Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Meaning of statement/ operation performed in following system verilog code

Status
Not open for further replies.

hulk789

Junior Member level 3
Joined
Jul 18, 2015
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
211
Code:
for (i = 0; i < 8; i = i + 1)
	  begin
	     test[8*i+7-:8] = array[326+i];// What is the operation performed?
	  end
What operation does 8*i+7-:8 perform?
 

Code:
for (i = 0; i < 8; i = i + 1)
	  begin
	     test[8*i+7-:8] = array[326+i];// What is the operation performed?
	  end
What operation does 8*i+7-:8 perform?

This has nothing to do with SV it's straight up 2001 verilog.

The slice defined by:
8*i+7 -:8
results in bytes of a larger bus

and....

Well it's a screwed up way of writing the simpler:
8*i +:8

Basically it's a byte wide slice from a bus taken from the i th byte
e.g.

i=0: eight bits starting from 8*0, 7:0
i=1: eight bits starting from 8*1, 15:8
...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top