If Chip would add a command-line option to compile and another one to load the generated bin, then we can use our favorite editors and just shell out to PNUT for those two needs.
So to reiterate what I said earlier about the outputs that they should be AND'ed rather than OR'd to allow any cog to pull a pin low without being blocked due to the fact that chip-enables and serial transmit and I2C and 1-Wire etc are all active low lines. The typical approach in P1 was to dedicate a cog to PASM for say the SD card and other cogs would pass commands and data via "mailboxes" to that cog. However even with P1 using Tachyon it was more effective to allow any cog to handle the device directly since the high-level routines were common and Tachyon code is fast. In many cases however the problem with this simple and efficient direct approach was the blocking effect of the OR'ed pins. One way around that was to make sure the active low outputs had pull-ups on them so they would at least idle high when released by a cog. Having AND'ed outputs solves all that and it still works the same way for any cog that wants to use an output except it "blocks" low.
As for chip naming I can't see why it should be called something different since it clearly has the Propeller architecture characterized by eight or more independent cogs with 9-bit local source and destination address combined into conditional instructions connected to a common hub memory. Sure it has been enhanced to the hilt with interrupts and FIFOs and streamers and a Cordic solver etc etc but it still has these basic characteristics which distinguish it from all others.
Pins' outputs can be inverted via the whole smartpin arrangement. Any any cog wrote a '1', the pin would go low.
last week i bought a DE0-Nano on ebay (for a good price:)
I play around with it and do some programming examples, it all works.
For the first prop2 test i used the "DE0_Nano_Bare_Prop2_v3.jic" with USB-Serial-Prog like shown
in "DE0_Nano_Bare_Prop2_Hookup" - no problems.
Now i would like to use my self made DAC:
Do i have to use the "DE0_Nano_Prop2_v3.jic" image ?
PNut finds no more Propeller 2 with this image or do i have to use other Prog-Pins ?
I also try out GPIO_211/212/0 _IN_0 instead of GPIO_3/5/7.
I'm a little bit confused. What is the exact difference between those both Nano-Images ?
Thanks in advance
Tharkun,
Here is the pinout list that maps the DE0_Nano's FPGA pins to the DACs and everything:
Hey, chip wanted to fill event slots. This is a good suggestion.
Perfect!!!
On second thought, maybe worthless. The thing is, you would be much more interested in tracking milliseconds, or something, all along the way, rather than knowing that this big long-period counter just rolled over. It's rollover event may not tie meaningfully to anything practical.
Hey, chip wanted to fill event slots. This is a good suggestion.
Perfect!!!
On second thought, maybe worthless. The thing is, you would be much more interested in tracking milliseconds, or something, all along the way, rather than knowing that this big long-period counter just rolled over. It's rollover event may not tie meaningfully to anything practical.
What do you think?
I'm not following, but you are right. We don't need it.
I think people can use the timers most of the time. Having a CNT rollover is of marginal value in that sense. But, it's also a simple bit of code that can be included, and it may make great sense for people not using interrupts much at all.
If nothing better comes along, perhaps it still makes sense to add it to one of the unused event numbers.
Edit: And there it is! No worries. We shouldn't add it.
Is there still a CNT, or is it now one of CT1,CT2,CT3 ?
Well, there is still a system counter/clock that can be retrieved with GETCNT. CT1, CT2, and CT3 are internal registers that get compared against the system counter and set event flags/interrupts. ADDCTx is used to set those registers. In the case above, I just set CT3 to trigger an interrupt when the system counter rolls around to zero.
Edit:
I wonder if all that's really necessary is:
mov ijmp3, #isr
pollct3
setint3 #3
Assuming that the registers initialize to zero, just clear the pending event on startup...
On second thought, maybe worthless. The thing is, you would be much more interested in tracking milliseconds, or something, all along the way, rather than knowing that this big long-period counter just rolled over. It's rollover event may not tie meaningfully to anything practical.
What do you think?
It could be used as a system watchdog, and/or time-base extension.
If there is a spare event lot, this seems a good use, and it does not consume a CT register, just to manage > 32b times.
Even something as simple as time-since-last-reset could be useful in the field.
If Chip would add a command-line option to compile and another one to load the generated bin, then we can use our favorite editors and just shell out to PNUT for those two needs.
Chip,
Is this something you could easily/quickly do along with the next FPGA release?
I'm guessing it can't..
But, if it can, does it count as an instruction?
It can't. I'm not sure what would happen if you tried - I suspect the first REP would be canceled by the second REP. The other possibility would be that the second REP would count as a NOP (which would count as 1 instruction).
If Chip would add a command-line option to compile and another one to load the generated bin, then we can use our favorite editors and just shell out to PNUT for those two needs.
Chip,
Is this something you could easily/quickly do along with the next FPGA release?
... I think I see we switched at some point to a period.
So, I guess I have to make it ".loop".
Does the reason for making that change still exist? I can't find any other use of colon...
Universal in other assemblers is colon after a label
LabelN:
; and some have period for local names, or some local label prefix (or suffix...)
.LocalName
Call LabelN
Given Prop GCC includes an Assembler(as), now seems a very good time to morph the PNUT syntax, so it has fewer incompatibilities.
Even as has some variances in documents
This https://sourceware.org/binutils/docs/as/Symbol-Names.html
gives "By default, the local label prefix is '.L' for ELF systems or 'L' for traditional a.out systems, but each target may have its own set of local label prefixes"
Well, if it's not too late, I'd vote for going back to colon...
It's pretty powerful be able to copy and paste P1 code into P2 and have it work...
Copy-Compatibility with P1 went out the window a long time ago, and to me, it is more important to be able to easily use the same P2 ASM code in the two assemblers that will support P2. (and of course, any ASM code for P1 done in as )
Some translation software scripts can be used to help move P1 PASM to P2
There is some value in maintaining as much compatibility as possible between the P1 and P2 assembly syntax. I think that a lot of the code from the OBEX will be ported to P2, and it would be nice to minimize the amount of changes required to do this. Of course, P2 has many more features than P1 and some changes are necessary. However, I think it is best to avoid arbitrary changes that don't really provide any benefit. I think the change from ":" to "." was an arbitrary change that wasn't necessary.
Comments
Pins' outputs can be inverted via the whole smartpin arrangement. Any any cog wrote a '1', the pin would go low.
Tharkun,
Here is the pinout list that maps the DE0_Nano's FPGA pins to the DACs and everything:
You'll need this document to bridge the FPGA pin numbers to the DE0-Nano pinout:
http://www.terasic.com.tw/cgi-bin/page/archive_download.pl?Language=English&No=593&FID=75023fa36c9bf8639384f942e65a46f3
Perfect!!!
On second thought, maybe worthless. The thing is, you would be much more interested in tracking milliseconds, or something, all along the way, rather than knowing that this big long-period counter just rolled over. It's rollover event may not tie meaningfully to anything practical.
What do you think?
Yes. It will click on after the streamer, so it doesn't really disrupt anything.
I'm not following, but you are right. We don't need it.
That's because we already have it:
If nothing better comes along, perhaps it still makes sense to add it to one of the unused event numbers.
Edit: And there it is! No worries. We shouldn't add it.
Well, there is still a system counter/clock that can be retrieved with GETCNT. CT1, CT2, and CT3 are internal registers that get compared against the system counter and set event flags/interrupts. ADDCTx is used to set those registers. In the case above, I just set CT3 to trigger an interrupt when the system counter rolls around to zero.
Edit:
I wonder if all that's really necessary is:
Assuming that the registers initialize to zero, just clear the pending event on startup...
If there is a spare event lot, this seems a good use, and it does not consume a CT register, just to manage > 32b times.
Even something as simple as time-since-last-reset could be useful in the field.
Chip,
Is this something you could easily/quickly do along with the next FPGA release?
I'm guessing it can't..
But, if it can, does it count as an instruction?
It can't. I'm not sure what would happen if you tried - I suspect the first REP would be canceled by the second REP. The other possibility would be that the second REP would count as a NOP (which would count as 1 instruction).
That circuit has enough to loop and count with zero overhead.
That's it.
I'll look into it.
Nice one
and got an error on the colon. I think I see we switched at some point to a period.
So, I guess I have to make it ".loop".
Does the reason for making that change still exist? I can't find any other use of colon...
Universal in other assemblers is colon after a label
Given Prop GCC includes an Assembler(as), now seems a very good time to morph the PNUT syntax, so it has fewer incompatibilities.
Even as has some variances in documents
This https://sourceware.org/binutils/docs/as/Symbol-Names.html
gives
"By default, the local label prefix is '.L' for ELF systems or 'L' for traditional a.out systems, but each target may have its own set of local label prefixes"
and this
http://tigcc.ticalc.org/doc/gnuasm.html#SEC48L
is mostly the same, but misses the above '.L'comment
Local labels start with a period now.
LabelN:
OK. I think that comes under the as comment above.
It's pretty powerful be able to copy and paste P1 code into P2 and have it work...
There are some subtleties between the two architectures that make copying and pasting a tricky notion, though.
BTW: I very rarely use ":", it's mostly Chip's code that seems to have them everywhere...
Copy-Compatibility with P1 went out the window a long time ago, and to me, it is more important to be able to easily use the same P2 ASM code in the two assemblers that will support P2. (and of course, any ASM code for P1 done in as )
Some translation software scripts can be used to help move P1 PASM to P2
To me, it looks like just the fancy instructions are different.
I just copied and pasted the multiply routine from the P1 manual and it worked, except for the this ":" business.
I think a lot of my P1 code would work nearly as is too.