Tachyon for Idiots
rjo__
Posts: 2,114
in Propeller 2
OK... so exactly how do I load Tachyon onto a P123A9?
Comments
BTW, I'm assuming you have loaded FPGA images before.
If you want the extended RAM version then you can use pnut or p2asm/loadp2 to compile and load the kernel and thereafter have that TAQOZ compile all the modules. I will post some instructions regarding this shortly.
EDIT: I dug out my CVA9 board with the latest ROM I used for testing, just to double check. Fired up minicom (I used 921600 baud) and entered > space escape and hey presto.
Then I type "lsio" at the prompt to list the I/O pin status.
The " -- " is inserted once the line is accepted when you hit enter and its sole purpose is to make it clear that what's on the left of this is user input and what's on the other side is the response, otherwise copy&paste as an example will be confusing for anyone else reading as to what was typed.
Then reinserted the card that was in it.
TAQOZ in ROM is a good place to start with learning to use TAQOZ and using it to test and explore hardware is what it is really good at.
This is the exercise which is a mix of code typed on the console and comments which is mostly copy'n'pastable.
EDIT: fixed an error in the listing
Click the link in my sig to download the latest binary and then F11 that in via Prop tool or BST. Hookup a terminal set to 115200k and hit ^C (control+C) to get it to reset again so you can see what it says.
If you have color enabled (but not required) it should look like this: (BTW, Tachyon for the P2 is called TAQOZ but it works pretty much the same way)
Thank you. I do indeed have TAQOZ and it does work. It's a miracle.
>> CLKFREQ . 80000000
You also have a ton of stuff linked through the P2 link in your signature. Where is the full version for P123A9?
Here are my initial impressions after about two hours of looking... that's about all you'll get from your average idiot. I'm going to hang here, but by now the average idiot will already have made up his mind.
1. I don't care about stacks. When Chip starts talking about stacks, I know he isn't talking to me.
The first two hours of an idiot's time is like the first day of a Driver's ED class. I don't need to know how to design a camshaft to drive a car. If I need to know about stacks to use TAQOZ, I'm going to fail. It is just a matter of time.
Recommendation:
If you want to attract newbies, you need to treat the entire conversation about stacks as a footnote.
2. It is very clear how to generate the list of defined words... but the next question never really get's answered to my understanding:what does the word actually do. Your document is immensely helpful... but there should be a command that let's me see the inner working of a word without having to dial up a website and after two hours, I don't see it. I got close, but when I tried to follow the instructions and see the innards I ended up with "Deadbea4, Deadbea3,Deadbea2, Deadbeaf" Not sure what Deadbeaf is, but (true story) last night I went to BurgerKing and tried to order 2 Whoppers for $6 and the lady actually said... "sorry we are all out of Whopper meat." So, maybe it has something to a freezer that got hacked by the Russians.
Recommendation:
needs a better word:)
The thing is that with Forth you have to care about the stack. If you are going enforce artificial limits on your understanding you will fail.
When talking about C, your camshaft analogy may work. When talking about Forth, it's not something hidden away under the hood, but more like the road you are driving on.
The way it works is like those spring loaded plate storages you might find in a cafeteria: First in, last out with some opportunity to look at the plates near the top.
you do not want to hear about the stack ...
but want to see the inner workings of a word ??
1. as @AJL said - the stack is essential to FORTH,
like you want to program C/Basic/... and don't want to hear about variables ...
2. you can see the inner workig of a word - very simply typing ... maybe not in the ROM version ... but in the extended
but then you need to invest a little more to make sense out of it.
However, admittedly, stack maintenance in Forth can be a total pita. Another stack-oriented language, Postscript, makes this a lot easier with its mark and cleartomark words. But operators like these require type-awareness in the stack, IOW requiring a separate type stack, or at least a bit array to keep track of where the marks are.
-Phil
Propeller code is normally provided as source or as a binary or both. The thing is that as the source is updated the binary may not be because that requires a couple of extra steps to transfer the full Tachyon image as a binary back onto Dropbox since most of the code is compiled by Tachyon on the Prop itself.
But when you want to just try it out, the binary is the best way to go.
As for Spin/PASM source code, when you hit F11 it compiles it on the PC and generates a binary that is downloaded into the RAM and then EEPROM. So either way it is loaded into a Prop as a binary.
"Would be nice" rather than "should be" I would think. Developing software on a PC can spoil us and lead to high expectations. Tachyon runs totally on the Prop itself. However, both the P2 EVAL and P2D2 have micro SD as standard and I do have a mechanism both for decompiling a word and also another for viewing the original source. I started generating HELP files in Tachyon for the P1 and I have yet to do the same for the P2. Assuming that you had the HELP folder loaded on your SD card, you could type HELP HIGH for instance and it would locate and display the help file that covered this word such as this one here:
Generating and maintaining the help files is probably one of those low priority tasks but one that anyone can help generate too.
I have absolutely no idea what you were doing and how you got there, maybe a copy&paste of your terminal would help me. However DEADBEEF is normally the hex value that is used to indicate a problem, in this case an empty stack is never really empty and so the stack registers are preloaded with dummy $DEADBEEF values that substitute the last digit with 1 to 4 for debug purposes. Now I'm guessing you tried the REVEAL word I had in the exercise, but if you ran that on an empty stack rather than from the SHIFT_OUT word, then those $DEADBEEx values will print out for sure.
STACKS
One thing I will say about stacks though. As Phil said, they can be a pita, but I find if you want to stuff junk into your back pocket then that can be a pita too. Same with stacks, keep it lean, which is why Tachyon only ever worries about the top 4 stack elements and tries to avoid even having that many for any one function. Take for instance the PANEL word that draws a filled rectangle on the VGA display. Normally you would have to provide 5 parameters to it, but I only provide one. That keeps the PANEL word simple and easy to deal with. Instead I create 4 words x y w h which you can guess their function, and each one is a word that takes one parameter. How does it look? Surely anyone could figure this one out (I would hope). So while stacks can be a pita if you let them, don't let them, keep it clean and simple by factoring your code as in the case of PANEL.
BTW, since PANEL only requires a single stack parameter, that means I could follow the "red panel" with "white panel" and then "blue panel" and since the y variable is updated by h each time I draw a panel, guess what I end up with?.
Traditional Forths will feature PICK and ROLL so you can grab the 8th parameter etc. What a total pita that is. What is the 8th parameter after all this stack juggling? I don't know, and I don't want to know which is why I will NOT implement these words in my system since they encourage bad practices.
BTW, the FPGA version does not have the silicon's PLL clock circuitry and so it runs at 20Mhz or 80Mhz.
I will generate an updated P2-EVAL binary that has all the goodies loaded and update my sig with a direct link shortly.