-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how do I synthesize this in quartus for the de0 nano #86
Comments
Have you installed FuseSoC? That will take care of pulling in all the files, create a Quartus project for you and build the design. Just run 'fusesoc build de0_nano' after you have installed FuseSoC. After that, you can open the Quartus project file (located in build/de0_nano/bld_quartus) if you prefer to work from Quartus |
Okay, I did get fusesoc from the git, ran autconf -i When I run ~/bin/fusesoc, I get the following (i do have a ~/lib/python2.7 directory created). I am not admin so, is that okay to have them there or should I have him do an install as root? ssheikh@gs-560g3080090e:~$ ~/bin/fusesoc |
Never mind...I set PYTHONPATH=/home/ssheikh/lib/site-packages and fusesoc is cranking on quartus for my de0-nano....too cool if it works!! |
I programmed the de0_nano. Now how do I load the program? In the orpsoc-cores/systems/de0_nano/utils, I see a program called It seems it run a mkimage. Where does that come from? I have a linux 12.04 Salman On Thu, Aug 13, 2015 at 7:02 AM, Olof Kindgren [email protected]
Even a Smile is charity :)
|
Hi, Sorry for the late reply. mkimage is part of u-boot. There are several ways to load a program. Either you can connect via JTAG, write the program to RAM and run it directly from there. In that case I recommend you to read up a bit on openocd. I've also outlined the procedure for another project here https://github.com/myriadrf/STREAM/blob/master/stream_openrisc_soc/doc/quickstart.html The part about openocd should be very similar on the de0 nano The other way is to put a program into the SPI Flash and boot it from there. In that case flash_helper.sh will help you put together an image and put it into the Flash. Hope this helps |
I am attemping to add another uart to the de0_nano. I modified the How do I do run that program and where is it? Salman Error (10161): Verilog HDL error at orpsoc_top.v(631): object On Tue, Sep 22, 2015 at 3:13 PM, Olof Kindgren [email protected]
Even a Smile is charity :)
|
Hi, you can find wb_intercon_gen here: https://github.com/openrisc/orpsoc-cores/blob/master/cores/wb_intercon/sw/wb_intercon_gen So, in order to add another uart in your system you need to edit your wb_intercon.conf and add your new uart. Then ./wb_intercon_gen wb_intercon.conf wb_intercon.v If you want quicker help you can join #openrisc on freenode IRC. Franck. |
I did it manually..edited both files by hand...now I need to find some Salman On Tue, Sep 29, 2015 at 2:44 AM, Franck Jullien [email protected]
Even a Smile is charity :)
|
Hi Salman, I assume that you are running a bare-metal program. If you are running an OS, such as Linux, the answer is different Anyway, the bare-metal toolchain (or1k-elf-) uses newlib, which in turn calls libgloss to carry out the hardware-dependent tasks, such as reading and writing characters from/to a UART. The OpenRISC-specific code for libgloss can be found here https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=tree;f=libgloss/or1k;h=e0fb2ac034c5d238e6ec9c04b73c94b666326673;hb=HEAD Specifically for the UART, there is or1k_uart.c which handles the low-level functions. It expects to find a UART at base address _or1k_board_uart_base, which in turn is defined in libboard. So to sum it up, a printf in your code calls the printf function in newlib, which calls _write in libgloss, which in turn calls or1k_uart_write Looking at or1k_uart.c now, I realize that these functions aren't really built to handle additional UARTs. For now, I think your best option would be to copy or1k_uart.[c,h], and make your own version where you can set a base address to your second UART. We should probably make a better fix for this some time //Olof |
Does anyone have a Openrisc fusesoc implementation for the ProASIC3 fpga? On Thu, Oct 8, 2015 at 9:08 AM, Salman Sheikh [email protected]
Even a Smile is charity :)
|
Hi Olof Trying to use flash_helper.sh and de0_nano.cof to merge the FPGA configuration and application firmware into one image (did I understand correct?), and then use quartus_pgm to upload the generated .jic file to EPCS flash. However, I noticed the HEX_OFFSET in the de0_nano.cof is 524288. Is it true that this offset should be >= sof size + sof starting address to avoid overlap. If the sof file I generated with Fusesoc is 709373, shall I increase the HEX_OFFSET to be greater than 709373? Thanks, |
hmm.. good question. I'm not completely sure, but I think that the sof file is compressed somehow. Looking at https://www.altera.com/en_US/pdfs/literature/hb/cyclone-iv/cyiv-51008.pdf page 4, the sof size is larger than 524288, so you could perhaps increase the offset to be sure, but it has always worked for me to put it at the original offset. Note however that if you change this offset, you will also need to tell the boot loader to look for the program at the new address. You can do this by entering ~/.local/share/orpsoc-cores/systems/de0_nano/sw and run |
Hi Olof I tried both 0x80000 and 0x100000 per your reply, but neither worked after I uploaded the jic file onto the board. What makes me confuse here is some older tutorials I found online, in which a "bin2binsizeword" program is called to replace the first word of application image with the the size of itself. However I didn't that step in your "flash_helper.sh". Is it obsoleted? Thanks, |
bin2binsizeword is obsoleted. It was an old, very simple image format that just used the first word to indicate the size of the image. I figured it was better to use an existing format instead and chose therefore uImage, which is the same format as uBoot is using. The spi_uimage_loader (which I assume you are using as the bootrom) expects the application image to use the uImage format. At this point it's hard to tell what could be wrong. The bootloader doesn't provide any visible clues about what is going on. Some ideas for further investigation
|
Hi Olof Still struggling to compile a functional .jic file, but no luck so far. However the .jic file you provided works on my board. I'll try to debug more following your suggestion. I have some questions after briefly reading through the source codes. Please correct me if I am wrong: According to sw/spi_uimage_loader.S on the line
and after search
So the flash chip (EPCS64) is wired to spi0, and looks like this could be verified from the pin map and de0_nano schematic. However, in rtl/verilog/orpsoc_top.v, I found two lines of codes causing my confusion:
why is the boot address pointing to
But I couldn't find any implementation of rom0 either in source code or in the pin map. I might be complete wrong... they are two different things.... And my theory is when the FPGA gets power-on or reset, it turn to Thanks again for your help. |
At least we're closing in on the error :)
Yes, this is correct
The boot ROM doesn't have any external connections. It's just a small memory that sits on the instruction bus so that mor1kx can read the instructions stored there. https://github.com/openrisc/orpsoc-cores/blob/master/systems/de0_nano/rtl/verilog/orpsoc_top.v#L486 is where you would find the instatiation of the boot ROM.
The FPGA will automatically load the FPGA configuration from address 0 of the SPI Flash. As the FPGA is empty on power-on it must be able to do this by itself when it is empty. Once it's loaded and the reset is released, the system is set up to always start reading it's first instructions from the boot ROM at There are a few things that might be the problem now.
|
Hi Olof Found from the de0_nano.map.rpt that:
I believe I did use the spi_uimage_loader.vh for the build. Th FPGA image was generated on a brand new cache of orpsoc-core as I cleared the ~/.local/share/orpsoc folder and re-initialized the fusesoc before building. I think the cores should have been downloaded freshly by the fusesoc, right? It would be extremely helpful if you can generate an image for me to test on my board, could be a good reference whether or or not I should inspect problem No.2..... Thanks again for your explanation of the boot ROM. So the boot ROM is some memory allocation on the FPGA silicon that stores the bootloader program ( A good test could be, actually you already suggested, to replace the Thanks, |
Hi Xueming, Sorry for the late reply. Here's a sof file that I have created. https://www.dropbox.com/s/hyms72zj1m5f4r0/de0_nano.sof?dl=0 Please note that I haven't tested it though, since I don't have access to my board. Your thoughts are all correct, and using the led blinker as a boot ROM would give us info if the boot loader is executing correctly. You can do this by running |
Thanks again, Olof, for sending the
At this point, I think the FPGA image (including the bootrom) is working correctly. Now the problem seems to be:
Sorry for the long reply. And I appreciate your help very much! |
Hi Olof Please ignore my Q1 as your code is correct. Just ran a test to output the "Image Magic Number" from U-Boot image on LED indicators, and it showed 0x27051956, which matches the U-Boot header definition. |
Hi Olof Finally I had my build working on the board now!! I haven't completely nailed down the causes behind this, but it looks like all my issues were caused by Linux vs. Windows version of Altera Quartus software. And this is what I did: I copied the whole folder, which was generated by the fusesoc, and was never successfully compiled to run on the de0_nano board, from Linux to a Windows computer. Compiled again with Windows version Quartus 16, converted to jic with a uimage, downloaded into the on-board flash, and it worked! Some observation:
Thanks again for your time. |
Hi Xueming, Sorry again for the late reply, but excellent news that you got things working, even if not everything is perfect yet. Some notes
|
Thanks again Olof for all your help. I'll keep you updated once I figured anything regarding the Linux/Windows issues, but so far I still don't know why. So I've moved on to adding a custom core to the CPU. Where is the best place for me to ask questions regarding this? I'm pretty I'll have a lot of questions. Best, |
Good question. I think the openrisc mailing list might be the best place. You can register at https://lists.librecores.org/listinfo/openrisc |
I am trying to add the top level in a quartus project but many hdl files are missing from the core dir that the top level calls out.
The text was updated successfully, but these errors were encountered: