if (cpu_as_n) rindex <= rindex_latch
change is not working if that it prevents register 1 from being written.
There is an sdram simulator here, in the Mini Cortex test bench:
https://gitlab.com/pnru/cortex/-/blob/master/sys_tb.v#L292-385
Note that it only does 512KB of sdram as written, but making it larger is simple tweak.
Maybe for a test it is easier not to simulate the mouse, but to generate eg. x1 directly and have a minimal test program in the ROM.
If I have time tomorrow, I'll see if I can set up a test bench using the simple M68K system and the SCC code.
Also apio might not be using --compress on ecppack.
Nice, I will look at that. the bit files are many times bigger
Hello everyone, I'm having a bit of an issue trying to build a project for ULX3S using Yosys/NextPNR (under apio). NextPNR seems to be complaining about combinational loops:
ERROR: timing analysis failed due to presence of combinatorial loops, incomplete specification of timing ports, etc.
But I don't seem to find what loops is it referring too. Forcing nextpnr to run ignoring errors, it throws this warning around 30 times. I thought it was because of how I handle FSM states but trying to follow a more "conventional" approach didn't seem to fix those. Doing so I got a seeming valid bitstream but in the FPGA it didn't work as expected (most of the signals didn't come out the expected ports at all), even though the simulations looked OK to me. So I think these timing issues could be the problem.
It's the first time that I try to create something for the board and I'm a bit lost on how to fix these issues... if anyone could help taking a look at the design and see if there's something obvious I might be missing I'd really appreciate it: https://github.com/jdesiloniz/ulx3s_numeric_display/tree/main/rtl
Thanks a lot!
clk_divider.v
doesn't create that issue and I could synthetize and run a small blinker on the ULX3S based on that without issues.
If anyone is interested in getting the ftp approach going in APIO then:
You need to change a couple of son files in .../python3.7/site-packages/apio/resources/
Add to programmers.json
(with your correct ip address for the board):
"ftpecp5prog": {
"command": "ftpecp5prog",
"args": "192.168.0.89"
}
Add to boards.json
:
"ulx3s-85f-ftp": {
"name": "ULX3S",
"fpga": "ECP5-LFE5U-85F-CABGA381",
"programmer": {
"type": "ftpecp5prog"
},
"usb": {
"vid": "0403",
"pid": "6015"
}
}
now use ulx3s-85f-ftp
instead of ulx3s-85f
in your apio.ini file.
This is for the 85, for others just copy and rename the relevant block in boards.json.
@emard @charlesap I've uploaded a new version of the Oberon system that is more comfortable on timing:
https://gitlab.com/pnru/ulx3s-misc/-/tree/master/oberon_pnr
The big change is that the CPU now has a gated clock for pausing instead of the stallX signal (similar to what the FleaOhm version does, but smaller in scope as that system pauses the entire SoC and not just the CPU).
This change allows an even simpler setup of the cache controller. It brings Fmax for the CPU up to 30-32MHz (it still runs at 25MHz). The cache runs at 100MHz, as does the block RAM. Typically I get an Fmax of 115-120MHz, although occasionally NextPNR generated a bad layout with an Fmax of 97-98MHz.
There is something strange about the reset sequence. The Oberon station seems to need a long reset after loading the bit stream; subsequent resets only need a 20ms debounce. I think this may be related to the Oberon operating system. I am under the impression that on startup the Oberon OS checks ram for certain values and performs a "warm reset" if they are set. After a warm reset, the led's stay at 0x84 instead of moving all the way to 0x20, and the Oberon screen outputs "Abort at ..." in the top-right window.
@lawrie Have a look at this figure from the MC68000 user manual on bit savers:
In a real cycle, your SCC chip select becomes active along with ASn. On the rising edge between S3 and S4 the SCC will read RR2B and reset rindex back to 0. On the rising edge between S5 and S6 it will hence read RR0B. The 68K CPU clocks in this value on the falling edge between S6 and S7.
My thinking was to defer the set/reset of rindex until the rising edge between S7 and S0. The set/reset of rindex_latch happens twice (S4 & S6), but that should be okay. I am not sure why the simple deferral until ASn was high again did not work.