Nov 20, 2015 #1 H 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?
Nov 20, 2015 #2 ads-ee Super Moderator Staff member Joined Sep 10, 2013 Messages 7,944 Helped 1,822 Reputation 3,654 Reaction score 1,808 Trophy points 1,393 Location USA Activity points 60,207 hulk789 said: 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? Click to expand... 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 ...
hulk789 said: 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? Click to expand... 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 ...