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.

Dont understand the meaning of this LOOP (VHDL)

Status
Not open for further replies.

BlackOps

Full Member level 5
Joined
Jan 1, 2005
Messages
279
Helped
14
Reputation
28
Reaction score
3
Trophy points
1,298
Location
AZERBAIJAN
Activity points
2,496
I am studying the VHDL code generated by the Peripheral Wizard in EDK 9.1

there is such piece of code:
Code:
        for byte_index in 4 to 14 loop
          if ( mst_byte_we(byte_index) = '1' ) then
            mst_reg(byte_index) <= Bus2IP_Data(
                                     (byte_index-(byte_index/(C_DWIDTH/8))*(C_DWIDTH/8))*8 to
                                     (byte_index-(byte_index/(C_DWIDTH/8))*(C_DWIDTH/8))*8+7);
          end if;
        end loop;

C_DWIDTH = 64

for example, if byte_index is 4.. then: (4 - ( ( 4/8 ) * 8 ) ) * 8 = 0, dosnt matter what is value of byte_index, Bus2IP_Data will always have value of [0 to 7] inside...

then why does the wizard not just writes Bus2IP_Data(0 to 7) ?? why is it using such complicated equation? or i am wrong somewhere?

thanks
 

I think, this "user logic" file is just a generic template generated by EDK. It is parametrized.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top