-
Notifications
You must be signed in to change notification settings - Fork 244
Add iCESugar-nano board #145
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
base: main
Are you sure you want to change the base?
Conversation
|
I didn't see any obvious issues in the code. Tried building it here and didn't see any issues in the logs either. I don't have the board so can't test it it, but attaching my build tree if you want to try the FPGA configuration produced by my build or compare anything. |
Follow the 6 steps to add support for a new target.
Step 1: Locate input and output pins.
Step 2: Add pin constraint file. This covers clock input, LED and UART
output.
Step 3: Create a clock generator. The chip has no internal clock
generator so the external 12 MHz clock is used.
Step 4: Add top level servant_ice40_cm36 which connects the one-wire
output of servant to both the LED and UART pin.
Step 5: Add fileset including the new top level and pin constraints.
Step 6: Add target icesugar-nano.
|
Did you get it working, @paller ? |
|
I'm no expect when it comes to HDLs and my initial printf() style debugging didn't help much. Either the LED is on, off, or blinking, which doesn't say a lot about anything. Any pointers on how to debug this issue would be appreciated. I had some ideas, some better than others. 1: More blinking LEDs 2: Embedded tracer 3: Route signals onto output pins The question is how to access wires in sub-modules as I don't want to add a lot of debug outputs just to access signals at the top level. If I remember correctly it was possible to do something like module top (input clk, output debug);
cpu_module cpu();
assign debug = cpu.alu.op_code; // <--- this
endmodulebut it required setting |
|
It looks like the CPU is somewhat running. There is very little space left for anything on the FPGA but it's possible to embed a single Manta IOcore which lets me poke around. Slowing the clock down to track all RAM reads (wb_mem_rdt) I get the following sequence. Comparing that with blinky.hex it's a match. It just doesn't seem right when it reads all zeros. |
|
Assuming the CPU is executing the right instructions the next link in the chain is the IO for the GPIO module. Reading the signals First state Second state Updating the GPIO pin is conditionalized on two signals where |
|
I don't have many good ideas but a few comments on your observations. I agree that it looks like the memory has been programmed correctly (nice to see Manta in action also!). I wonder about the traces though. We only care about the value of There is one thing I would like you to try though. AFAIK, this is the only target with a memsize that is not a power of two. There might be some issue there. Could you try setting memsize to e.g. 4096 instead and see if that makes a difference? |
Follow the 6 steps to add support for a new target.
Step 1: Locate input and output pins.
Step 2: Add pin constraint file. This covers clock input, LED and UART
output.
Step 3: Create a clock generator. The chip has no internal clock
generator so the external 12 MHz clock is used.
Step 4: Add top level servant_ice40_cm36 which connects the one-wire
output of servant to both the LED and UART pin.
Step 5: Add fileset including the new top level and pin constraints.
Step 6: Add target icesugar-nano.
I would expect this to be it, but the LED is not blinking.
If I add a reset function, something like 5 seconds in reset, 5 seconds run time. No blinking LED.
Setting a ~1 second reset each 10 seconds, still no light.
Debugging with a single LED as output I must say, it's pretty hard. If I drive the LED from the top-level scope or mix my debug signal with the servant's 'q' output, the LED is blinking according to the debug signal just fine, but only driving the LED from the servant output makes no light.