Jump to content

trossin

Newcomers
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

trossin's Achievements

Newbie

Newbie (1/4)

1

Reputation

  1. Well. That did work (when I changed from MCS to BIN as MCS caused a crash for me) but it took 8 seconds to load the FPGA after power up. I did some searching and stumbled upon some secrets and hints and put them together to get things going in milliseconds instead of seconds. The secret is to add these lines to your constraints file before synthesizing the design (I include the steps needed to find these settings): set_property BITSTREAM.GENERAL.COMPRESS TRUE [current_design] set_property BITSTREAM.CONFIG.CONFIGRATE 33 [current_design] set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design] Here is the recipe that worked for me on a project named SerialPort to write flash memory and get the FPGA loaded quickly at power up: Make an bin file by selecting Tools/Generate Memory Config File My board has the SPI flash part with a-SPI71 500 MX25 L3233F printed on it (32Mbit Marcronix device) Select BIN format Click Memory Part and select the flash memory part (mx25l3273f-spi-x1_x2_x4 by using the Search feature [mx25l32 should be enough]). The mx25l3273f is similar to 3233 which is also a 32Mbit Marcronix device but no Hold feature on SIO3. Select a destination next to Filename: (in your project folder like SerialPort.runs/impl_1/SerialPort.mcs). Change the Interface to SPIx4. This requires the following in your constraint file before you built the design: set_property BITSTREAM.GENERAL.COMPRESS TRUE [current_design] set_property BITSTREAM.CONFIG.CONFIGRATE 33 [current_design] set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design] Click the Load bitstream files check box and add the bitstream for your project SerialPort.runs/impl_1/SerialPort.bit Click Overwrite. Press OK Open Hardware Manager, plug board into USB port then Open target then Auto connect Right click on device (xc7a35t_0) and select Add Configuration Memory Device ... Select the flash memory part (mx25l3273f-spi-x1_x2_x4 by using the Search feature [mx25l32 should be enough]) Macronix | MX25L3233FZBI-08G/Q | mx25l3233f (alias of mx25l3273f [also 32Mbit Marcronix device but no Hold feature on SIO3]) Don't program it now as from now on there will be no need to add this device to the project and the programming will be done by selecting the flash memory device that was just added. Once the device has been added, to program it, right click on it (mx25l3273f-spi-x1_x2_x4) and select Program Configuration device (it needs a .bin or .mcs file). Select the bin file that was generated from the bit file above. Click Ok to program the flash. When done, unplug the board from the USB port and plug it back in again and it should load your design. The secret to finding the magic BITSTREAM settings: Click Open Implemented Design (if you don't, you can't select additional settings later on). Once opened Right click on Generate Bitstream and select Bitstream Settings Click on Configure additional bitstream settings (near the top) General: Enable Bitstream Compression TRUE Configuration: Configuration Rate (MHz) Change to 33 Scroll down and set Bus width under SPI Configuration to 4 Click OK Click OK Close the Implemented Design and save the settings to a new file, copy and paste the BISTREAM settings to your configuration file and remove the new file from the project. Now that there are new constraints, the whole process needs to be repeated to get the settings into the bitmap file so that they can be transferred to the bin file Now it boots instantly instead of taking 8 seconds! I have no idea if the Configuration Rate can be made faster or not but seems good enough at 33MHz.
  2. Thanks Arthur, This worked: clk_wiz_0 MmcmPllThing( .clk_out1(Clk) ,.locked(Locked) ,.clk_in1(RefClk) ); Your screen shot made me think I had to connect 20 signal so I freaked out at first. Now I see that clk_wiz_0 is above clk_wiz_0_clk_wiz in the hierarchy so I should have inserted that into my design instead. Thanks for the help.
  3. Yes. I already instantiated the MMCM after using the clock wizard and saw it was added to the project. But when I went to build the project, it said it could not find the Verilog for the wrapper I instantiated. So, I found the code and manually added it. Then the project built and worked in HW but gave me a warning about the wrapper being added twice. I will try again from a blank project and try to repeat. If I can do that, I’ll try quitting after the first build error and reload the project and see if a reload allows the build to work without adding the wrapper manually. I will mention that I have had the tool crash on me a few times and I also accidentally start Vivado twice (takes a long time to show splash screen). I have found that certain operations fail or crash if I have a second instance running or the tool crashed and I did not reboot. This might be my issue as the first time I used the clock wizard, it crashed during generation. Maybe it left a turd that won’t be around if I just try again. Thanks for your help. I’ll let you know how it goes.
  4. What can I say, I'm new to Vivado and searching the web for how to program the flash only came up with how to do it in 2018 which did not apply or how to mess with MicroBlaze issues. I just have a little toy project which uses the MMCM, some counters and a UART I wrote to flash the LEDs. I don't want to trash my board so I figured it would be better to ask the seasoned veterans before pushing the program button. The bit file I created works fine. I just want to make sure I know how to burn it into the serial flash device so I can create projects that power up without a laptop attached. Below are the steps that I came up with for Vivado 2023.2. Please let me know what I should be doing differently. Thanks. To burn design into serial flash once a bit file has been created: Make an mcs file by selecting Tools/Generate Memory Config File My board has the SPI flash part with a-SPI71 500 MX25 L3233F printed on it. Lots of lenses to see this! (32Mbit Marcronix device) Click Memory Part and select the flash memory part (mx25l3273f-spi-x1_x2_x4 by using the Search feature [mx25l32 should be enough]). The mx25l3273f is similar to 3233 which is also a 32Mbit Marcronix device but no Hold feature on SIO3. Select a destination (in your project folder like blah.runs/impl_1/Blah.mcs). I left the Interface as SPIx1. It seems that the flash device supports SPIx4 but I'm afraid. Will SPIx4 work? Click the Load bitstream files check box and add the bitstream for your project blah.runs/impl_1/blah.bit Click Overwrite and maybe Checksum. Press OK Open Hardware Manager, plug board into USB port then Open target then click Auto connect Right click on device (xc7a35t_0) and select Add Configuration Memory Device ... Select the flash memory part (mx25l3273f-spi-x1_x2_x4 by using the Search feature [mx25l32 should be enough]) Macronix MX25L3233FZBI-08G/Q mx25l3233f (alias of mx25l3273f [also 32Mbit Marcronix device but no Hold feature on SIO3) Don't program it now as in the future, there will be no need to add this device to the project and the programming will be done by selecting the flash memory device that was just added. Once the device has been added, to program it, scroll down and right click on it (mx25l3273f-spi-x1_x2_x4) and select Program Configuration device (it needs a .bin or .mcs file). Select the mcs file that was generated from the bit file above. Click Ok to program the flash.
  5. When using Vivado (2023.2), if I use the Clocking Wizard from the IP catalog (under FPGA Features and Design) to add the MMCM/PLL to my project it seems to add it under sources. But, when I click Run Synthesis, it does not find the wrapper file clk_wiz_0_clk_wiz.v and fails. So, I just manually add it to sources as it exists down at ProjectName.gen/sources_1/ip/clk_wiz_0/clk_wiz_0_clk_wiz.v. Now the project will compile but gives me a warning about this file has been included twice. Ugh. Is this normal or is there some secret that I missed?
  6. I guess I'm answering my own question. I now see that the reset input is an optional port to the MMCM so I created another project and unselected the reset port and it works fine. Just a clock in, clock out and locked signal. I can make the reset using the locked signal. All is good. Here is my source that converts the 12 MHz clock into 100 MHz to flash the LEDs (I should have more flops on nRst but it is just an example): module Fun( input RefClk ,output[1:0] Led ,output[2:0] nRgb ); wire Por,Clk,Locked; reg[21:0] Counter; reg[2:0] Count; reg CountEn,nRst; clk_wiz_0_clk_wiz MmcmPllThing( .clk_out1(Clk) ,.locked(Locked) ,.clk_in1(RefClk) ); assign Led = Count[1:0]; // 50% duty cycle as it is too bright assign nRgb = Counter[15] ? Count : 7; always @(posedge Clk) begin nRst <= Locked; Counter <= (~nRst) ? 0 : Counter + 1; CountEn <= Counter==1 ? 1 : 0; Count <= (~nRst) ? 0 : CountEn ? Count+1 : Count; end endmodule
  7. So I looked around and see that there is no power on reset for this module that can be used by internal logic. I've used a board with a Lattice FPGA that also didn't have a power on reset but like this device will initialize all flops to zero when the programming is done. On the lattice board, I just created a counter on the reference clock that counts up to 20 and while counting asserts reset into the PLL. I then used this reset and the locked output from the PLL and more synchronizing flops on the PLL output clock to generate a system reset which is required for 1 hot state machines to work. I thought I would do the same thing with the Vivado tools but the synthesis tool got pissy about putting flops on the same clock as the reference clock to the MMCM/PLL so that does not work. What I did was tie the MMCM/PLL reset to zero and just use the locked output to generate my reset and things worked. Did I get lucky or is this the recommended way to generate a power on reset? P.S. I found that the built in simulator ignored my inital/begin code to set my little counter to zero. Icarus was able to simulate it correctly (and gets me results quicker so I stick with that until I need the built in simulator for some other reason like IP modeling).
×
×
  • Create New...