-
Notifications
You must be signed in to change notification settings - Fork 56
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
j4a : do..loop not thread-safe #34
Comments
Ahh, I actually think this might be my doing. On Sun, May 29, 2016 at 5:59 AM, RGD2 [email protected] wrote:
James Bowman |
Oh, thank god! I saw >r and r> and made an assumption. I see now - it's in j1a/nuc.fs Hmm... I might leave this issue open, until I get a better appreciation for how swapforth interacts with the j4a... (in regards defining words at least). Off the top of your head, can you think of any other spots that might not be "thread safe" like this? |
I think I may just add an additional private context register to the j4a to resolve this (via the io space), I can then just rewrite the Until I get a better feel for swapforth, I'm loath to completely fork away from swapforth/j1a. |
I stumbled across the hive processor on opencores.org the other day (whilst looking for a 16x16 signed multipliers to poach... found one!) I wouldn't be unhappy with having a third, very shallow stack around, to solve this exact issue in a way which just extends the cpu context a little. And it would also help integrate said 32 bit multiplier too, allowing places to source and send data to/from in 32 bit chunks, without necessarily going to a 32 bit internal datapath. The hive has 8 stacks, which I think is excessive, since I can't see a good way to implement forth on it efficiently (tend to use just 2/8 or 3/8 of them) and it would take a couple clocks to properly update both data and return stacks... :( It's a really neat, very well documented 'barrel cpu' design though (like j4a) ... hats off to Eric Wallin. If only he hadn't given up so soon on python (and if only he'd met verilator...) oh well. |
FWIW, here's a workaround:
|
Ok, this is one's on me...
I get odd behaviour if another thread (say, $100 io! ) is running a DO ... LOOP and I run another bit of code, also with a do loop...
(this requires a ice40-HX8K Breakout Board be plugged in)
It doesn't always do it - maybe 5% of the time or so - I exaggerated it a bit above.
I think this means the timing for the stack2pipe4 module isn't quite right... strange thing is, the system seems otherwise quite stable in actual applications.
I'll have a go at getting the verilator interactive build of the j4a going, and see if it does it too. (in which case it's just a logic bug.)
Otherwise this might be some form of odd timing or interference issue with the icestorm tools. Perhaps there are some constraints about routing nearby signals which might interfere under certain conditions we don't know about yet? I hope not... But, if so, then it might perhaps share a root cause with #25 .
I have confirmed the above behaviour on both of the boards I have.
The text was updated successfully, but these errors were encountered: