Using the prop as a slowish FPGA...
Cluso99
Posts: 18,069
It struck me this morning that a prop can be used as a slowish FPGA with/without the other prop's abilities.
I cannot recall anyone mentioning this before???
How...
Well, take a cog and program it in spin to repeat a loop where outputs are a function of inputs. For speed, you could do this in pasm. Each fpga block could be done in a different cog if speed is an issue.
Really, what we do with objects is not that much different to implementing it in an fpga - just the language is different, and of course a software implementation is slower.
Here are some simple samples...
I cannot recall anyone mentioning this before???
How...
Well, take a cog and program it in spin to repeat a loop where outputs are a function of inputs. For speed, you could do this in pasm. Each fpga block could be done in a different cog if speed is an issue.
Really, what we do with objects is not that much different to implementing it in an fpga - just the language is different, and of course a software implementation is slower.
Here are some simple samples...
' 3 input AND gate repeat A := B and C and D ' 3 input OR gate repeat A := B or C or D ' more complex gates repeat A := (A and B) or C
Comments
I've been playing around with VHDL and Verilog http://en.wikipedia.org/wiki/Verilog
It may not be too hard to do.
Oops, sorry. It would be absolutely impossible on the Propeller
"Software as silicon" is a catch phrase used by XMOS in describing it's multi-core, timing deterministic processors and the same applies to the Propeller.
This is another application area that needs a language between Spin and PASM.
For real-world logic replacement, the final code needs to reside in COGs and be easily cog-split, as needed.
A natural extension from Boolean equation entry is to allow PLC like operation, and here a compiler could follow an existing PLC-specific language like :
http://en.wikipedia.org/wiki/IEC_61131-3
or it may be able to be based on a defined subset of existing 'simpler' languages like
http://www.freebasic.net/wiki/wikka.php?wakka=CatPgFullIndex
Latches can be done by using internal variables and saving/latching them on an edge or level.
Dracula: I think Verilog/VHDL is much more complex than what I am thinking of. But maybe there could be translation/compiler software - but of course its IMPOSSIBLE
"Each DSP48E1 slice fundamentally consists of a dedicated 25
This is a D latch in verilog. Output Q follows the input D and it is stored on the positive going edge of a clock. One would need another hidden variable to store the previous state of the clock so you could detect the positive edge.
I think fpga IDEs like Quartus can convert schematics to verilog. So you could draw a schematic, convert to verilog, convert to pasm, and 'program' a propeller using schematics.
Completely crazy. And impossible.
BTW That signature quotation is a gem
State engines are quite powerful and usually easy to follow.
The CUPL Language (PLD) syntax goes like this
In a more conventional uC language, a Looping case statement with a Case variable (likely enum ) would be used.
The FreeBasic syntax for CASE is here
http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgSelectcase
The last link in that thread will take you to a post that includes the actual code. Also "Search" on picoplc to find more threads that discuss this program.
For the uninitiated, ladder logic is very close to being a state-machine description of a system.
-Phil
I am switching over from playing with Xilinx bits to Altera bits as I have found a load of scrap stuff that has MAX, FLEX, APEX and Cyclone(1)s. I have started a QFP208 board and to get around the 0.5mm pitch I have lifted alternate pins, some to go to an upper layer, and the others to go to the lower layer. A bit like through-hole surface-mount ... with a big hole ;-)
Yes, the real Z80 plus Propeller plus RAM idea was where we started all those years ago. I still think it is something that just has to be done.
But, damn it, I just discovered that an electronics store near here has a stock of original Motorola 68000 processors which they are selling at 1 Euro each.
You know what that means...68000 plus Propeller 2 module with it's 32MB of SDRAM....
i was thinking that the Prop(1) could be the Z's RAM as well. If you got used to the initial 1K user Ram, and then caused intense jealousy by being the first of the group to 16K ... who needs more than 16K????
I still have a load of "61256" SRAMs along with one 6116 I think it was the lack of 4118 ram and the resultant costs that did for Nasco. I saw some 4116 DRAMs the other day but the gits wouldn't let me have them. They are probably landfill now.
What about using a Z80 plus three or four Prop 1 ?
Have each Prop serve up 16K of it's RAM for the Z80 and still have a load left over to make them useful as peripherals. Terminal, sound, SD card etc etc.
http://forums.parallax.com/showthread.php/148418-Pico-C?highlight=picoc
This might be a stupid question since I haven't paid much attention to ZiCog, but considering that many of those early systems ran at 1 MHz is there any reason it would be impractical to use one Prop running ZiCog with a couple of 32K SPI RAMs supplying the Z80 RAM and the rest of the Prop's cogs doing peripheral stuff?
Now there is an intriguing idea. I still have several systems under contract that use the same Z80 board, and some of the parts are becoming very hard to find as well as being pretty expensive.
ZiCog development has been on hold for a long while during which time propgcc has appeared and with it a whole slew of new external memory options and cached drivers for them.
So yes, adapting ZiCog to those new solutions has exactly been on my mind. As has reimplementing all the Spin parts in C.
Of course there is also the Prop II comming which will not need external RAM for running CP/M.
Well if you are going to do that sort of clever boffinry, then I guess we should think about running a Z80 emulation using the same external cached ram chips. Add one of the new wizzo 8 pin SPI ram chips and the cache driver from gcc, and I think it might be up to 10x faster than some of the parallel latch solutions we had.
And sorry cluso for turning your fpga thread into a Z80/Zicog thread. To move back on topic, once that new Z80 emulation is working, then next step would be to write a Verilog to C (addit - google says already done) translation and run it using something that ran under CP/M, like BDS C. Then you could have a fpga running in CP/M which is in turn running on the propeller.
It would satisfy the criteria of this original post in that it would be 'slowish'
Replace the real CPU and put an emulation in the Prop and we are in the realm of big FPGAs being configured with CPU cores written in VHDL/Verilog. Much like the current Prop II core in a Cyclone that is available.
It's all on topic:)
http://www.brielcomputers.com/wordpress/?cat=17
That Apple I replica is neat and his use of a Propeller as the video hardware is pretty clever. During the late 70's to early 80's I was squarely in the 6502 microcomputer camp. So I'm fairly ignorant of CP/M or the Z80.
On topic. Isn't software sort of the ultimate FPGA? I would think that any logic layout you could conceive of would have an equivalent program that does the same thing.
Clearly anything we can specify as a program we can specify as a hardware logic design and vice versa. After all when it comes to actually making the thing work it's all just a bunch of logic elements anyway.
http://www.brielcomputers.com/wordpress/?cat=18
The replica 1 only interfaces with the 6821 (Peripheral Interface Adapter PIA) to the propeller chip so it isn't really glue logic. I have however been working on a project that uses the Propeller as video RAM to directly address the 6502 address bus to a Propeller as random access video. I choose to use a 65C02 at 3V so I could skip all the resistors for voltage level transition. I've been working with Jac Goudsmit and he really helped me with the video driver code. Using another cog, I was able to use the Propeller to emulate the boards ROM thus booting from the Propeller memory and driving the 1 MHz clock with the Propeller as well.
I need to get everything together in a generic format for release. I'm sure others may want to use the code for other things.
Vince,
Thanks for joining us and sharing your useful information. I visit your website often.
Jim
I got infected with Z80itis as my first computer used that, wheras the USA side got the 6502 which I never tried to learn much about, even though I did have a C64, C128 and a BBC B (without the add on PCB). I know that the C64 used interleaved access to the RAM so that got some speed back so that should be just what the HUB ordered.
Alan
I still have RamBlades and every now and then I play with them, and the OS (FAT16/32) that coexists with it. FTF works 3 of the 4 directions (fat to cpm incomplete). I have often looked at speeding up the ZiCog emulation using mixed variations of overlays and LMM. There are other things that could be done too. While a few Z80 opcodes are not implemented or faulty, the other Z80 implementation (by ??? - my memory fails me) does fix this. IMHO the SPI implementations are just not going to cut it for speed on the P1. My RamBlade implementations use a separate prop for the I/O via high speed serial. My smallest is 2x 1"sq pcbs that stack - basically a whole CP/M machine in 1"x1"x0.4"h with either a serial port or a PS2 keyboard and monochrome composite video interface. Of course it also runs my PropOS (FAT16/32) as well as Catalina. In fact I run a huge Catalina C program on this block in a commercial product. (for those who know me, I didn't write the C program).