Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Question on basic coding

Hi I'm a newbie on this forum and just entered into Verilog HDL recently.

As a beginner i am quite confused about how pin assignments work. If the user imports DE2 pin assignments.csv directly from Quartus database, is he/she NECESSARY to use SW,LEDG,LEDR,etc to write the Verilog code? I found it quite tedious to write in this way instead of using normal variables such as x,y,z....

Is there any easy way to assign normal variables to SW,LEDG,LEDR so we can use them inside the code? Or is this method completely unacceptable?

Thanks for spending time to help.

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi, fkmtac09.

    I'm also a beginner.

    In my opinion, if you want to use your own variable name, you shouldn't import the pin assignments.csv file. You can write the module, and then assign the pin in the Pin Planner. Here, you should note that you must assign the pins according to the reference book(maybe DE2 pin assignments.csv ).

    regards,

    zhangfeng
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks a lot for the help. Seems like the code is going to be messy if I adopt this way of coding.