Jeremy W. Langston

Personal Website

DE2-70 SOPC Tutorial Introduction – A list of problems…and solutions!

I recently purchased a Terasic DE2-70 Cyclone II development board.  The makers have two prices:  $599 commercial and $349 academic.  If you’re a college student, the academic price is still too much.  After I got a job, made some money, and saved up, I sent the Taiwanese company Terasic a little email.  I told them I recently graduated and wanted to get the academic price, stating that I would be using it for personal learning, etc.  They were more than happy to offer the discount, so I’m now the proud owner of a DE2-70.  (By the way, they ship from Taiwan – viz. $40 shipping from the other side of the world.)

Well, having gone through Altera’s “Introduction to the Altera SOPC Builder Using VHDL Design” to remember how to use the software, I found multiple problems with the tutorial as it is.  I hope that listing the solutions here will help people in the same situation.  Some of these issues are obvious, and some are a bit more subtle.

I am using Quartus II 7.2 and  NiosII 7.2.

  1. In Step 1: “In your project, choose the EP2C35F672C6 chip as the target device, because this is the FPGA on the DE2 board”. Well, the DE2-70 uses a different chip.  Choose the EP2C70F896C6.  This can be verified by simply looking at the text printed on the FPGA.
  2. In Step 1: “You can choose a different directory or project name, but be aware that the SOPC Builder software does not permit the use of spaces in file names”. This is true and I just wanted to make it obvious that you can’t have a space *anywhere* in the pathname.  For example, you would have problems in SOPC  Builder if your project was in “C:\Program Files\…” since that path contains a space.
  3. In Step 6: “In the On-Chip Memory Configuration Wizard window, shown in Figure 8, set the memory width to 32 bits and the total memory size to 4 Kbytes”. As I’ll be getting to shortly, the 4kB is not enough for the NiosII project.  Crank it up to 64kB for plenty of breathing room.
  4. In Step 7: The PIO is under Peripherals -> Microcontroller Peripherals -> PIO (Parallel I/O).
  5. In Step 9: The JTAG UART is under Interface Protocols -> Serial -> JTAG UART.
  6. After Step 11: Write down the base addresses of the PIOs after auto-assigning the addresses.  These will be needed for NiosII, as they are treated as memory-mapped I/O.
  7. Before Step 12: There are a couple “To Do”‘s in the message window of SOPC Builder about the NiosII CPU that need to be addressed:  the reset and exception vectors.  Double-click the NiosII component you instantiated to open up the properties window you were at before.  Now that you have on-chip memory instantiated, click on the Reset Vector and Exception Vector Memory drop-down boxes and select the name of your memory (e.g. “onchip_mem”).  Leave the offsets the way they are (0x0 and 0x20).  Don’t worry about the “Warning: Switches: PIO inputs are not hardwired in test bench. Undefined values will be read from PIO inputs during simulation.”, this tutorial doesn’t do any test benches.
  8. Importing DE2_70_pin_assignments.csv.  This comma-separated file is located on the DE2-70 CD included with the kit, and it can also be found on the internets.  Mmm, google.  The naming convention for this Altera-supplied file changed from DE2 to DE2-70.  Open it and take a look.  There are now lower-case ‘i’s and ‘o’s before many of the hard-wired signals denoting them as input and output.  Remember this!  The HDL code needs to change reflecting this.  Otherwise the .csv needs changing, but I don’t suggest it.  Here’s my resulting code (remember, the port names may be different for your SOPC component):
    • LIBRARY ieee;
      USE ieee.std_logic_1164.all;
      USE ieee.std_logic_arith.all;
      USE ieee.std_logic_unsigned.all;

      ENTITY lights IS
      PORT (
      iSW        : IN    STD_LOGIC_VECTOR(7 DOWNTO 0);
      iKEY    : IN    STD_LOGIC_VECTOR(0 DOWNTO 0);
      iCLK_50 : IN    STD_LOGIC;
      oLEDG    : OUT    STD_LOGIC_VECTOR(7 DOWNTO 0)
      );
      END lights;

      ARCHITECTURE Structure OF lights IS
      COMPONENT nios_system is
      port (
      — 1) global signals:
      signal clk : IN STD_LOGIC;
      signal reset_n : IN STD_LOGIC;

      — the_LEDs
      signal out_port_from_the_LEDs : OUT STD_LOGIC_VECTOR (7 DOWNTO 0);

      — the_Switches
      signal in_port_to_the_Switches : IN STD_LOGIC_VECTOR (7 DOWNTO 0)
      );
      END COMPONENT;

      BEGIN
      NiosII:        nios_system PORT MAP(iCLK_50, iKEY(0), oLEDG, iSW);
      END Structure;

  9. Before Section 3.2: If you’ve tried to do a full compilation at this point, you will probably see an unexpected error:
    • Error: Can’t place pins assigned to pin location Pin_AD25 (IOC_X95_Y2_N1)
      Info: Pin iSW[7] is assigned to pin location Pin_AD25 (IOC_X95_Y2_N1)
      Info: Pin ~LVDS195p/nCEO~ is assigned to pin location Pin_AD25 (IOC_X95_Y2_N1)
      Error: Can’t fit design in device
      Error: Quartus II Fitter was unsuccessful. 2 errors, 3 warnings
      Info: Allocated 215 megabytes of memory during processing
      Error: Processing ended: Sun Oct 18 19:11:13 2009
      Error: Elapsed time: 00:00:03
      Error: Quartus II Full Compilation was unsuccessful. 2 errors, 152 warnings
    • Here is the fix:
      • In Quartus-II select menu Assignments>Device…
      • Select button “Device and Pin Options…
      • Select the tab “Dual-Purpose Pins”
      • Under the list of “Dual-purpose pins:” change the “Value” property of nCEO to “Use as regular I/O”.
      • Click OK
  10. After Section 3.2:  If you are using the Web edition or didn’t buy the full license for the Altera IP, you probably got a pop-up window after programming the device stating “OpenCore Plus Status Click Cancel to stop using OpenCore Plus IP.  Time remaining:  unlimited”.  Do not close this window if you intend on using the NiosII IDE to run on the hardware.  Just leave the window up and close when you are done, or have a problem with Quartus or SOPC Builder.
  11. I skipped over the Assembly programming section because this tutorial already gave me a headache.  I’m not a masochist.
  12. In Section 4.2: When you create a new project, create it in the following way:  File -> New -> Project… and select “Nios II C/C++ Application”.  Also, use the Hello World template.  It sets everything up for you, gives you printf functionality to the console, but takes up a bit more space.
  13. lights.c:  Here’s what I have in my file.  Again, it might be a bit different for the base addresses.
    • #include <stdio.h>
      #define Switches (volatile char*) 0x21000
      #define LEDs (char*) 0x21010

      int main()
      {
      printf(“Hello from Nios II!\n”);
      while (1){
      *LEDs = *Switches;
      }
      return 0;
      }

  14. After all of that is done, you right-click on your project in NiosII IDE (e.g. hello_world_0) and click “Run As -> Nios II Hardware”.
  15. Done!  You can now move the switches (SW7 – 0) and see the LEDG7-0 change.  You can also reset the CPU using KEY0.

I know how frustrating it can be trying to learn something when the tutorial is wrong.  Hope this helps!

42 Comments

  1. The Ponmankal builders have launched luxury villas in Kottayam. The villas in Kottayam are at the heart of the Kottayam city where all needs are accessible from the nearby location. The villas are very spacious and with ample appearances.

  2. Embark on a journey into the world of DE2-70 SOPC with this comprehensive tutorial introduction. Explore the fundamentals and intricacies of System-on-a-Programmable-Chip technology. Dive into the realm of digital design and expand your knowledge base. Discover more with Games For Android

  3. Your post is quite clear and I can tell you know a lot about the subject. If it’s okay with you, I’d want to subscribe to your RSS feed so I can stay up to speed on future updates. Thanks a lot, and keep up the good job!
    snapseed QR codes

  4. If you are searching for a track jacket in this winter season. So I will help you very much from where you will get it and from whom I bought Dunkings Track Jacket and I personally used it.

  5. Very nice and interesting sharing

  6. Professional biography writers would be impressed by your resourcefulness and initiative in securing a discount for your Terasic DE2-70 Cyclone II development board. Your ability to articulate your situation and negotiate a favorable outcome showcases valuable skills that could be highlighted in a professional biography. Additionally, your dedication to personal learning and professional development, as demonstrated by your investment in acquiring the necessary tools, reflects positively on your character and ambition.

  7. It’s interesting to see how persistence and initiative can pay off, especially when it comes to accessing educational resources like the Terasic DE2-70 development board. This anecdote highlights the importance of advocacy for fair pricing, particularly for students transitioning into the workforce. Companies like Terasic seem receptive to such requests, which is encouraging for individuals seeking to further their education and skills. And yes, the added mention of the shipping cost from Taiwan serves as a reminder of the logistical hurdles sometimes involved in acquiring specialized equipment. Overall, it’s a testament to the value of seizing opportunities and leveraging communication effectively. Professional biography writers could certainly extract valuable lessons from this narrative about resourcefulness and negotiation skills.

  8. Your experience with the DE2-70 board and navigating through the tutorial shows great perseverance and problem-solving skills! It’s impressive how you reached out to Terasic and got the academic price. Sharing your solutions and insights about the tutorial will surely help others facing similar challenges. Keep up the fantastic work, and remember, teamwork makes the dream work when it comes to overcoming obstacles like these! Your determination and collaboration with your team names. have truly paid off.

  9. Your experience with the DE2-70 board and navigating through the tutorial shows great perseverance and problem-solving skills! It’s impressive how you reached out to Terasic and got the academic price. Sharing your solutions and insights about the tutorial will surely help others facing similar challenges. Keep up the fantastic work, and remember, teamwork makes the dream work when it comes to overcoming obstacles like these! Your determination and collaboration with your team names. have truly paid off.

  10. Your experience with the DE2-70 board and navigating through the tutorial shows great perseverance and problem-solving skills! It’s impressive how you reached out to Terasic and got the academic price. Sharing your solutions and insights about the tutorial will surely help others facing similar challenges. Keep up the fantastic work, and remember, teamwork makes the dream work when it comes to overcoming obstacles like these! Your determination and collaboration with your team names have truly paid off.

  11. I’m truly impressed by the content of this blog post. It stands out for its uniqueness and provides valuable information.

  12. Your content is really great. İnformative and well-written. Keep up the good work!

  13. You provided a good list, thank you for your help, it was useful for me

  14. خرید آنلاین طلا

    March 17, 2024 at 4:04 am

    You provided a good list, thank you for your help, it was useful for me….خرید قسطی طلا

  15. The educational website offers a vast range of well-structured and comprehensive learning materials, making it an invaluable resource for students of all ages and levels.
    شركة مكافحة حشرات الكويت

  16. The educational website offers a vast range of well-structured and comprehensive
    شركة مكافحة حشرات الكويت

  17. I’d like to mention that this game is not only fantastic but also quite enjoyable. There is no need to download anything or join up in order to begin playing this board game on this platform, so if you find yourself bored in your spare time, you can come to this platform and start playing it.

  18. tips and tricks

    March 30, 2024 at 11:21 am

    The content you find on RankBuilder is more than just a piece of writing. It’s a stream pool of practical tips and tricks for entrepreneurs and other digital marketing enthusiasts who want to become successful. By reading our blogs you will find that things that seem complicated to you will become easier for you, whether it is SEO or online advertising.

  19. Many thanks for your comprehensive article on Portugal retirement visa
    . Your insights and advice have been extremely helpful in navigating through the requirements. Grateful for your expertise!

  20. Your journey with the DE2-70 board and your efforts in following the tutorial demonstrate remarkable perseverance and problem-solving abilities! It’s truly impressive how you proactively reached out to Terasic and secured the academic price. As you mentioned that it was impossible for you to arrange amount for this without job, I am also working for a website online nursing class help to make money along with my studies.

  21. Your journey with the DE2-70 board and your efforts in following the tutorial demonstrate remarkable perseverance and problem-solving abilities! It’s truly impressive how you proactively reached out to Terasic and secured the academic price. As you mentioned that it was impossible for you to arrange amount for this without job, I am also working for a website online nursing class help to make money along with my studies.

  22. Your journey with the DE2-70 board and your efforts in following the tutorial are amazing! as you mentioned that it was impossible for you to arrange amount for this without job, I am also working for a website online nursing class help to make money along with my studies.

  23. This is a perfect solution. I like such creations. Besides, I also have a more perfect solution which is apk mod. A safe solution for everyone who loves Android apps

  24. I love how you approached this topic from a different angle. It’s refreshing to see someone challenge conventional wisdom and offer new insights. Looking forward to reading more from you

  25. Casino4U offers a fantastic opportunity for Australian players to claim their rewards with their no deposit bonus guide. This platform provides a thrilling gaming experience with a wide range of exciting games and generous promotions. Australian players can enjoy top-notch entertainment and potentially win big without having to make a deposit. With a user-friendly interface and a focus on player satisfaction,https://teamaskin.com/claim-your-rewards-casino4u-no-deposit-bonus-guide-for-australian-players/ ensures a seamless and enjoyable online gaming experience. Whether you’re a seasoned player or new to the world of online casinos, this platform has something for everyone. Claim your rewards today and dive into a world of excitement at Casino4U!

  26. You may go to our website to play this online game provided by us. https://capitalscholarships.com/

  27. My foray into the world of gambling apps has been greatly enhanced by the invaluable resources found on https://auroragame.app/ The website’s intuitive layout and detailed game descriptions have streamlined my experience, making navigation effortless. The extensive selection of games ensures there’s never a dull moment, while the app’s reliability ensures smooth operation throughout. I’ve found withdrawals to be prompt, a testament to the platform’s commitment to customer satisfaction. With up-to-date information readily available, my journey has been both enjoyable and rewarding, leading me to confidently endorse this app to others seeking quality gaming experiences.

  28. Appreciating Dezinepro for their insightful blog content and exceptional interior design services. Elevate your home with Dezinepro!”

  29. Multiwood’s furniture isn’t just functional; it’s a work of art. Each piece tells a story of craftsmanship and dedication, making it a conversation starter in any office setting.

    For More Details: https://multiwood.ae/

  30. Multiwood’s furniture is more than just a collection of pieces; it’s a statement of style and professionalism. Whether it

    For More Details: https://multiwood.ae/

  31. The attention to detail in Multiwood’s craftsmanship is evident in every piece of furniture. It’s clear that they take pride in their work.

    For More Details: https://multiwood.ae/

  32. I’ve received so many compliments on the aesthetics of my office since furnishing it with Multiwood furniture. It’s helped create a professional and welcoming atmosphere.

    For More Details: https://multiwood.ae/

  33. You need to use a third-party service to use Spotify Receiptify and get a receipt of your most played songs.

    https://receiptifyus.com/

  34. Huzurlu Sapanca’da rahat ve şık bungalov tatili için ideal mekan. Doğanın içinde, konforlu ve unutulmaz bir deneyim için sizleri bekliyoruz!

  35. Möchten Sie Ihre Bekanntheit steigern und ein größeres Publikum erreichen? Dann ist es vielleicht an der Zeit, TikTok Follower PayPal. Hier ist der Grund:

  36. Your journey with the DE2-70 board and your tenacity in tackling the tutorial demonstrate remarkable perseverance and problem-solving abilities! It’s truly impressive how you proactively contacted Terasic and secured the academic pricing. By sharing your solutions and insights from the tutorial, you’re undoubtedly assisting others who encounter similar challenges. Keep up the fantastic work , and remember that teamwork plays a crucial role in overcoming obstacles. Your determination and collaboration with your team have undeniably yielded positive results! 🌟🚀

  37. Welcome to Yas Download’s online webpage. iPhone, iPad, iOS & Android video downloader with all features. You may download any video with this shortcut

  38. Don’t hesitate to try playing online games, because online games are very exciting games to play, when you play them you will feel a very extraordinary sensation in the game, well here we have a very exciting online game site for you. play, if you want to play it please visit this website https://alycefaye.com/

  39. The most trusted slot online site in Indonesia Receh77 with various bonuses awaits

  40. The most trusted slot online site that surely pays all Dana99

Leave a Reply

Your email address will not be published.

© 2024 Jeremy W. Langston

Theme by Anders NorenUp ↑