 |
|
 |
| Parallax Forums > Public Forums > Propeller Chip > Propeller Simulation in Verilog | Forum Quick Jump
|
|  jazzed _oOo_(^^)_oOo_
        Date Joined Jan 2008 Total Posts : 2114 | Posted 5/12/2009 4:27 PM (GMT -8) |   | Hi.
Thought I would reveal one of my Propeller projects. Verilog is a Hardware Description Language (HDL) for creating integrated circuits. I have created a single hub/cog module for simulations with Icarus Verilog. The model is not "cycle accurate" at this point (but will be) and is NOT intended for creating an image for use in an FPGA. The model does not borrow from anyone's previous work. Most of the PASM instructions have been added and many are verified to be working as expected.
What you see below is a dump of a COG simulation from a Propeller Verilog model. This is useful for connecting to other Verilog modules to verify ideas such as the Synchronous CPLD idea discussed in the 6.6MB/s thread. The dump specifically addresses the Asynchronous memory read model with data on P0..7 and address on P8..P31.
I've been working on running Chip's booter.spin code, but I've hit a wall there ... having trouble making Verilog share a pin on the EEPROM SDA line. For now I'll just give that a rest so I can focus on other things.
Using the Programming Language Interface (PLI), a model can read Propeller assembly and run the code on the COG simulation. In the future, I expect to add interfaces to "time-tick and pin data" files for describing inputs to the model so that one or more forms of a binary image can be shared ... and so that I don't have to give away my source code :). Once the full instruction set is verified, I may offer binary variations of this work on a "specified test bench."
C:\iVerilog\projects\propeller>test loadxmm
C:\iVerilog\projects\propeller>del loadxmm.binary
C:\iVerilog\projects\propeller>cat loadxmm.spin CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000
PUB main cognew(@initxmm,0)
DAT initxmm ' initialize mov dira, mask mov addr, par call #loadxmm8 call #loadxmm16 call #loadxmm32
' debug stuff finish or dira, #$ff mov outa, val
' kill cog cogid cog cogstop cog
loadxmm32 ' 16 total instructions for 3.3V < 50ns SRAM. Direct address/data bus mov outa, addr shl outa, #8 add outa, _0x300 'add to address to fix endian order nop mov val, ina 'xxxxxxxxxxxxxxxxxxxxxxxxAAAAAAAA . sub outa, #$100 ror val, #17 wc 'xxxxxxxxxAAAAAAAAxxxxxxxxxxxxxxx A0 movi val, ina 'bBBBBBBBBAAAAAAAAxxxxxxxxxxxxxxx A0 sub outa, #$100 shr val, #8 '........bBBBBBBBBAAAAAAAAxxxxxxx A0 movi val, ina 'cCCCCCCCCBBBBBBBBAAAAAAAAxxxxxxx A0 sub outa, #$100 shr val, #8 '........cCCCCCCCCBBBBBBBBAAAAAAA A0 movi val, ina 'dDDDDDDDDCCCCCCCCBBBBBBBBAAAAAAA A0 rcl val, #1 'DDDDDDDDCCCCCCCCBBBBBBBBAAAAAAAA A0 loadxmm32_ret ret
loadxmm16 ' 10 total instructions for 3.3V < 50ns SRAM. Direct address/data bus mov outa, addr shl outa, #8 add outa, #$100 'add to address to fix endian order nop mov val, ina 'xxxxxxxxxxxxxxxxxxxxxxxxAAAAAAAA . sub outa, #$100 ror val, #17 'xxxxxxxxxAAAAAAAAxxxxxxxxxxxxxxx A0 movi val, ina 'bBBBBBBBBAAAAAAAAxxxxxxxxxxxxxxx A0 shr val, #15 loadxmm16_ret ret
loadxmm8 ' 5 total instructions for 3.3V < 50ns SRAM. Direct address/data bus mov outa, addr shl outa, #8 nop mov val, ina 'xxxxxxxxxxxxxxxxxxxxxxxxAAAAAAAA . loadxmm8_ret ret
cog long 0 _0x300 long $300 addr long $0 mask long $ffffff00 val res 1
C:\iVerilog\projects\propeller>.\propellent /compile /savebinary loadxmm.spin
C:\iVerilog\projects\propeller>.\spin2pasm loadxmm.binary 1>loadxmm.txt
C:\iVerilog\projects\propeller>del tb_loadxmm
C:\iVerilog\projects\propeller>iverilog -o tb_loadxmm tb_loadxmm.v
C:\iVerilog\projects\propeller>vvp -v tb_loadxmm Compiling VVP ... Compile cleanup... ... Linking ... Removing symbol tables ... 2230 functors 160 table 0 bufif 32 resolv 980 variable ... 10338 opcodes (180224 bytes) ... 148 nets ... 9 memories ... 4 scopes Running ... VCD info: dumpfile propeller.vcd opened for output. $readmemh(loadxmm.txt): Not enough words in the read file for requested range. COG 0 un-reset 43 520 COG download 0 complete. PC 000 INST a0bfec2b COG 0 PASM[000] = a0bfec2b i 28 zcri 0010 MOV c f d 1f6 ffffff00 <- 00000000 s 02b ffffff00 DIRA C 0 Z 0 ioa 11111111111111111111111101010101 cnt 0000016c COG 0 PASM[001] = a0bc55f0 i 28 zcri 0010 MOV c f d 02a 00000040 <- 00000000 s 1f0 00000040 PAR C 0 Z 0 ioa 00000000000000000000000001010101 cnt 00000170 COG 0 PASM[002] = 5cfc4e23 i 17 zcri 0011 JMP c f d 027 5c7c0003 <- 5c7c0000 s #023 a0bfe82a C 0 Z 0 ioa 00000000000000000000000001010101 cnt 00000174 COG 0 PASM[023] = a0bfe82a i 28 zcri 0010 MOV c f d 1f4 00000040 <- 00000000 s 02a 00000040 OUTA C 0 Z 0 ioa 00000000000000000000000010101010 cnt 00000178 COG 0 PASM[024] = 2cffe808 i 0b zcri 0011 SHL c f d 1f4 00004000 <- 00000040 s #008 0c7c5003 OUTA C 0 Z 0 ioa 00000000000000000000000010101010 cnt 0000017c COG 0 PASM[025] = 00000000 i 00 zcri 0000 NOP c 0 d 000 a0bfec2b <- a0bfec2b s 000 a0bfec2b C 0 Z 0 ioa 00000000000000000100000010101010 cnt 00000180 COG 0 PASM[026] = a0bc59f2 i 28 zcri 0010 MOV c f d 02c ffffff55 <- xxxxxxxx s 1f2 ffffff55 INA C 0 Z 0 ioa 00000000000000000100000001010101 cnt 00000184 COG 0 PASM[027] = 5c7c0003 i 17 zcri 0001 JMP c f d 000 a0bfec2b <- a0bfec2b s #003 5cfc4419 C 0 Z 0 ioa 00000000000000000100000001010101 cnt 00000188 COG 0 PASM[003] = 5cfc4419 i 17 zcri 0011 JMP c f d 022 5c7c0004 <- 5c7c0000 s #019 a0bfe82a C 0 Z 0 ioa 00000000000000000100000001010101 cnt 0000018c COG 0 PASM[019] = a0bfe82a i 28 zcri 0010 MOV c f d 1f4 00000040 <- 00004000 s 02a 00000040 OUTA C 0 Z 0 ioa 00000000000000000100000010101010 cnt 00000190 COG 0 PASM[01a] = 2cffe808 i 0b zcri 0011 SHL c f d 1f4 00004000 <- 00000040 s #008 0c7c5003 OUTA C 0 Z 0 ioa 00000000000000000000000010101010 cnt 00000194 COG 0 PASM[01b] = 80ffe900 i 20 zcri 0011 ADD c f d 1f4 00004100 <- 00004000 s #100 xxxxxxxx OUTA C 0 Z 0 ioa 00000000000000000100000010101010 cnt 00000198 COG 0 PASM[01c] = 00000000 i 00 zcri 0000 NOP c 0 d 000 a0bfec2b <- a0bfec2b s 000 a0bfec2b C 0 Z 0 ioa 00000000000000000100000101010101 cnt 0000019c COG 0 PASM[01d] = a0bc59f2 i 28 zcri 0010 MOV c f d 02c ffffff55 <- ffffff55 s 1f2 ffffff55 INA C 0 Z 0 ioa 00000000000000000100000101010101 cnt 000001a0 COG 0 PASM[01e] = 84ffe900 i 21 zcri 0011 SUB c f d 1f4 00004000 <- 00004100 s #100 xxxxxxxx OUTA C 0 Z 0 ioa 00000000000000000100000101010101 cnt 000001a4 COG 0 PASM[01f] = 20fc5811 i 08 zcri 0011 ROR c f d 02c ffaaffff <- ffffff55 s #011 84ffe900 C 0 Z 0 ioa 00000000000000000100000010101010 cnt 000001a8 COG 0 PASM[020] = 58bc59f2 i 16 zcri 0010 MOVI c f d 02c 552affff <- ffaaffff s 1f2 000000aa INA C 0 Z 0 ioa 00000000000000000100000010101010 cnt 000001ac COG 0 PASM[021] = 28fc580f i 0a zcri 0011 SHR c f d 02c 0000aa55 <- 552affff s #00f 21fc5811 C 0 Z 0 ioa 00000000000000000100000010101010 cnt 000001b0 COG 0 PASM[022] = 5c7c0004 i 17 zcri 0001 JMP c f d 000 a0bfec2b <- a0bfec2b s #004 5cfc3009 C 0 Z 0 ioa 00000000000000000100000001010101 cnt 000001b4 COG 0 PASM[004] = 5cfc3009 i 17 zcri 0011 JMP c f d 018 5c7c0005 <- 5c7c0000 s #009 a0bfe82a C 0 Z 0 ioa 00000000000000000100000001010101 cnt 000001b8 COG 0 PASM[009] = a0bfe82a i 28 zcri 0010 MOV c f d 1f4 00000040 <- 00004000 s 02a 00000040 OUTA C 0 Z 0 ioa 00000000000000000100000001010101 cnt 000001bc COG 0 PASM[00a] = 2cffe808 i 0b zcri 0011 SHL c f d 1f4 00004000 <- 00000040 s #008 0c7c5003 OUTA C 0 Z 0 ioa 00000000000000000000000010101010 cnt 000001c0 COG 0 PASM[00b] = 80bfe829 i 20 zcri 0010 ADD c f d 1f4 00004300 <- 00004000 s 029 00000300 OUTA C 0 Z 0 ioa 00000000000000000100000010101010 cnt 000001c4 COG 0 PASM[00c] = 00000000 i 00 zcri 0000 NOP c 0 d 000 a0bfec2b <- a0bfec2b s 000 a0bfec2b C 0 Z 0 ioa 00000000000000000100001110101010 cnt 000001c8 COG 0 PASM[00d] = a0bc59f2 i 28 zcri 0010 MOV c f d 02c ffffff55 <- 0000aa55 s 1f2 ffffff55 INA C 0 Z 0 ioa 00000000000000000100001101010101 cnt 000001cc COG 0 PASM[00e] = 84ffe900 i 21 zcri 0011 SUB c f d 1f4 00004200 <- 00004300 s #100 xxxxxxxx OUTA C 0 Z 0 ioa 00000000000000000100001101010101 cnt 000001d0 COG 0 PASM[00f] = 21fc5811 i 08 zcri 0111 ROR c f d 02c ffaaffff <- ffffff55 s #011 84ffe900 C 1 Z 0 ioa 00000000000000000100001001010101 cnt 000001d4 COG 0 PASM[010] = 58bc59f2 i 16 zcri 0010 MOVI c f d 02c 552affff <- ffaaffff s 1f2 000000aa INA C 1 Z 0 ioa 00000000000000000100001010101010 cnt 000001d8 COG 0 PASM[011] = 84ffe900 i 21 zcri 0011 SUB c f d 1f4 00004100 <- 00004200 s #100 xxxxxxxx OUTA C 1 Z 0 ioa 00000000000000000100001010101010 cnt 000001dc COG 0 PASM[012] = 28fc5808 i 0a zcri 0011 SHR c f d 02c 00552aff <- 552affff s #008 0c7c5003 C 1 Z 0 ioa 00000000000000000100000110101010 cnt 000001e0 COG 0 PASM[013] = 58bc59f2 i 16 zcri 0010 MOVI c f d 02c aad52aff <- 00552aff s 1f2 ffffff55 INA C 1 Z 0 ioa 00000000000000000100000101010101 cnt 000001e4 COG 0 PASM[014] = 84ffe900 i 21 zcri 0011 SUB c f d 1f4 00004000 <- 00004100 s #100 xxxxxxxx OUTA C 1 Z 0 ioa 00000000000000000100000101010101 cnt 000001e8 COG 0 PASM[015] = 28fc5808 i 0a zcri 0011 SHR c f d 02c 00aad52a <- aad52aff s #008 0c7c5003 C 1 Z 0 ioa 00000000000000000100000001010101 cnt 000001ec COG 0 PASM[016] = 58bc59f2 i 16 zcri 0010 MOVI c f d 02c 552ad52a <- 00aad52a s 1f2 000000aa INA C 1 Z 0 ioa 00000000000000000100000010101010 cnt 000001f0 COG 0 PASM[017] = 34fc5801 i 0d zcri 0011 RCL c f d 02c aa55aa55 <- 552ad52a s #001 a0bc55f0 C 1 Z 0 ioa 00000000000000000100000010101010 cnt 000001f4 COG 0 PASM[018] = 5c7c0005 i 17 zcri 0001 JMP c f d 000 a0bfec2b <- a0bfec2b s #005 68ffecff C 1 Z 0 ioa 00000000000000000100000010101010 cnt 000001f8 COG 0 PASM[005] = 68ffecff i 1a zcri 0011 OR c f d 1f6 ffffffff <- ffffff00 s #0ff xxxxxxxx DIRA C 1 Z 0 ioa 00000000000000000100000001010101 cnt 000001fc COG 0 PASM[006] = a0bfe82c i 28 zcri 0010 MOV c f d 1f4 aa55aa55 <- 00004000 s 02c aa55aa55 OUTA C 1 Z 0 ioa 00000000000000000100000000000000 cnt 00000200 COG 0 PASM[007] = 0cfc5001 i 03 zcri 0011 HUBOP c f d 028 00000000 <- 00000000 s #001 a0bc55f0 C 1 Z 0 ioa 10101010010101011010101001010101 cnt 00000204 COG 0 PASM[008] = 0c7c5003 i 03 zcri 0001 HUBOP c f d 028 00000000 <- 00000000 s #003 5cfc4419 C 1 Z 0 ioa 10101010010101011010101001010101 cnt 00000208 Event counts: (event pool = 1364) 20290 thread schedule events 9833 propagation events 29326 assign events 440384 other events "Use: gtkwave propeller.vcd"
C:\iVerilog\projects\propeller>
--Steve
| | Back to Top | | |
 |  Rayman Registered Member
        Date Joined Jul 2007 Total Posts : 2408 | Posted 5/12/2009 4:41 PM (GMT -8) |   | | | |
  |  localroger Registered Member

       Date Joined Mar 2009 Total Posts : 417 | Posted 5/12/2009 5:12 PM (GMT -8) |   | | I think the FPGA would have trouble with things like the counters and PLL's. And aren't most FPGA's a lot more expensive than the prop now? | | Back to Top | | |
   |  jazzed _oOo_(^^)_oOo_
        Date Joined Jan 2008 Total Posts : 2114 | Posted 11/4/2009 10:37 AM (GMT -8) |   | I'm reviving this project. The goal has changed:
Create a functional FPGA with external HUB RAM that will be finished before Propeller II. A Propeller PASM compatible P8X32A/B FPGA core using 32MB external HUB RAM directly accessible to COGs in the natural way (directly accessible to LMM via special instructions) and running on Spartan 3E. I will abandon the effort only when Propeller II is ready for sale, when my FPGA board functions perfectly IMHO, I receive a "cease and desist letter" or post from Parallax, or stop for significant personal reasons.
The target hardware will initially be the Diligent Spartan 3E S3E1600 FPGA Board. ... This board has 32MB Micron DDR 5ns memory, 16MB Intel StrataFlash Flash, Xilinx Program Flash, 16MB Serial Flash, DB15HD VGA PS/2 keyboard, 2 DB9 RS-232 connectors, RJ-45 Ethernet, 16-pin header for optional LCD modules, I/O connectors, and USB for programing.
The Diligent 1600K board/PS is about $230, 500K board/PS is about $150 (international distribution available).
It is unclear how many COGs could be put into the 1600K device with on-board FPGA COG RAM and external HUB RAM, but more than 8 is likely. One of my design goals is to allow any number of COGs (8 more or less) that will fit into a given device. It is unclear if 8 COGs will fit into the Spartan 3E-500K.
I am committed to this since I'm sick of waiting for Propeller II, but I do not recommend anyone without sufficient knowledge in purchasing hardware until there is reasonable progress. Others who feel qualified are welcome to join me in development. | | Back to Top | | |
   |  jazzed _oOo_(^^)_oOo_
        Date Joined Jan 2008 Total Posts : 2114 | Posted 11/4/2009 1:49 PM (GMT -8) |   | @Ale, I don't know yet how big one COG will be. I'm working with the verilog from my simulation model now to make it synthesizable ... could be a while before that's ready.
As I said in so many words in another thread: I believe it's better to start too big than to start too small.
@Cluso99, I've already stated my intentions. If Parallax wants me to stop I will, but I am quite sick of waiting for Propeller II.
It's either this or abandon Propeller completely for me. I'm sure some folks here would like to see me abandon it and this forum :) | | Back to Top | | |
       |  Ale Registered Member

       Date Joined May 2007 Total Posts : 1267 | Posted 11/5/2009 10:40 AM (GMT -8) |   | | | |
  | Forum Information | Currently it is Friday, November 20, 2009 10:58 PM (GMT -8) There are a total of 393,737 posts in 55,521 threads. In the last 3 days there were 82 new threads and 702 reply posts. View Active Threads
| | Who's Online | This forum has 17687 registered members. Please welcome our newest member, mark09. 56 Guest(s), 6 Registered Member(s) are currently online. Details Peter Verkaik, BradC, Harley, Chris Savage (Parallax), Rich_W8VK, potatohead |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|