- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using Nios II, there is a need to read serial number of let's say Cyclone II. Can it be done, and how?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Only if you add an avalon slave (or custom instruction) to return the value from somewhere.
Possibly you could set the 'cpuid' register (control register 5) to some useful value.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used to do this to cook build numbers into the FPGA image so I could read it back if I ever needed to know what's currently operating in the FPGA. If you want something that you manually set once you can make a simple SOPC Builder/Qsys component that hardcodes the readdata line to whatever parameter setting you want. i.e. something like this:
module serial_number_reader (clk, reset, address, read, readdata); input clk; input reset; input address; input read; output wire readdata; parameter SERIAL_NUMBER = 32'hDEADBEEF; assign readdata = SERIAL_NUMBER; endmodule Then when you instantiate it you type the serial number into it as a parameter and every time you read from the component that value is returned. If you want something more programmatic for a build system you can use an pre-initialized on-chip RAM where your build system spits out a new .hex/.mif file before the hardware is compiled. If you want a true 'serial number' system (where each FPGA/board has it's own serial number programmed at the factory) you'll need something programmable on the board that Nios II can read from with the serial number burned into it.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some chips with unique serial numbers, such as MAXIM's DS2401.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page