Shop OBEX P1 Docs P2 Docs Learn Events
FPGA Prop1 - feature request - Propeller block symbol (edit 3 - solved) — Parallax Forums

FPGA Prop1 - feature request - Propeller block symbol (edit 3 - solved)

pik33pik33 Posts: 2,366
edited 2014-08-11 07:34 in Propeller 1
What we have now is an Verilog code wrapped in AHDL top layer
A request (of course I can do it myself but with no AHDL knowledge it will take some time to decode and understand these top files):

- a BDF file with the Propeller inside :) instead of top file with I/O pins added, so we can place it on a Quartus block diagram editor and connect its IO pins to anything we want - anything we have available on DE2-115 - instead of its GPIO pins.

Edit: partially solved, I have now a block with a propeller inside by simply creating a symbol file from a "top.tdf". It still needs some work (I have to rename some files and remove assignments to make my own "top" of quartus project)

Edit 2: removed "solved" icon because it is not solved.
I renamed "top.tdf" to "prop.tdf", then, inside a tdf file I changed subdesign top to subdesign prop.
Then I made a symbol file.
Then I started a new project, made a new top entity as a bdf file, put the prop symbol on it, connected inputs and outputs.

And when compiling this, I got:

Error (10170): Verilog HDL syntax error at dig.v(89) near text "+"; expecting "="

I didn't touch any of .v files.Lines 87..90 of dig.v are
genvar i;
generate
    for (i=0; i<8; i++)
    begin : coggen

where line 89 is for (i=0; i<8; i++)

So, now I don't understand this and feature request is still valid.

Edit 3. Solved. I have a Propeller with red LED signalling working cog instead of green one and reset on key0

Solution was simple: it uses System Verilog, not a plain Verilog. So after all renaming I described above, I had to go to Assignments->settings->verilog input and switch it to System Verilog..

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2014-08-07 03:22
    I admit that will browsing the source directory I wasn't sure which were the AHDL files. The Verilog ones are obviously the ones with the ".v" extension. Which are the AHDL files?
  • pik33pik33 Posts: 2,366
    edited 2014-08-07 03:45
    These .tdf files are written in AHDL.

    Now I will try to run this on DE1-SoC with Cyclone V.

    Still have no solution to program this thing - I have no PropPlug. DE2-115 has an RS232 but only Tx and Rx signals are connected :( No way to reset the Propeller
  • pik33pik33 Posts: 2,366
    edited 2014-08-07 04:02
    It compiled and seems to run on DE1-SoC (reset and led signalling cog0 works, stil have no idea how to program it without a propplug). Used 7898 ALMs of 32070 available.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-08-07 04:03
    Is there some reason other than history that some files are in AHDL and some are in Verilog? Would it make sense to convert the AHDL files to Verilog?
  • pik33pik33 Posts: 2,366
    edited 2014-08-07 04:19
    I think now it doesn't make sense to convert it to verilog. Just convert top AHDL file to block symbol file. Then you have a Propeller symbol with 32 bit i/o bus, clock input, signalling working cogs 8-bit output and reset input. Then you can connect it to anything you have on your board.

    All important details are in verilog files. Maybe we can make active these mul and div instructions?

    These AHDL files are top layer files which connects all of parts into one whole system.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-08-07 14:11
    By the way, what is a "symbol file"? Is this a way to package a bunch of logic into a block that you can use in other designs? If so, how hard would it be to make a single COG symbol file?
  • jmgjmg Posts: 15,173
    edited 2014-08-07 14:18
    pik33 wrote: »
    It compiled and seems to run on DE1-SoC (reset and led signalling cog0 works, stil have no idea how to program it without a propplug). Used 7898 ALMs of 32070 available.

    How does a Cyclone IV build compare with Cyclone V, for the FPGAs used on the obvious boards ?
    Logic/Ram/Speed ?
  • jmgjmg Posts: 15,173
    edited 2014-08-07 14:19
    David Betz wrote: »
    Is there some reason other than history that some files are in AHDL and some are in Verilog? Would it make sense to convert the AHDL files to Verilog?

    For targets other than Altera, it would make sense. For Altera, it is optional.
  • pik33pik33 Posts: 2,366
    edited 2014-08-07 21:38
    jmg wrote: »
    How does a Cyclone IV build compare with Cyclone V, for the FPGAs used on the obvious boards ?
    Logic/Ram/Speed ?

    I built and preliminary run it on DE1-SoC. Cyclone V has ALMs instead of LEs. ~7900 C5 ALMs vs ~16000 C4 LEs. It should run 1.5x faster with Cyclone V (150 MHz? its internal memory can work >300 MHz and PLLs >600 MHz), but I will have no data until I solve a lacking PropPlug problem. (maybe today)
  • jmgjmg Posts: 15,173
    edited 2014-08-07 21:44
    pik33 wrote: »
    I built and preliminary run it on DE1-SoC. Cyclone V has ALMs instead of LEs. ~7900 C5 ALMs vs ~16000 C4 LEs. It should run 1.5x faster with Cyclone V (150 MHz? its internal memory can work >300 MHz and PLLs >600 MHz), but I will have no data until I solve a lacking PropPlug problem. (maybe today)

    What do the speed report files say ?

    Chip did a quick build for C5, and reported this
    ["It turns out that even though this Cyclone V -A2 part has 25k LE's, the P8X32A takes 85% of them! That's 33% more LE's than it takes on the Cyclone IV. Plus, it took 3x longer to compile. Oh, and Fmax is still over 80MHz, but slower than Cyclone IV."]

    Maybe that is just a settings issue, but more CyV s CyIV build reference compares would be useful to check.
  • pik33pik33 Posts: 2,366
    edited 2014-08-07 22:45
    David Betz wrote: »
    By the way, what is a "symbol file"? Is this a way to package a bunch of logic into a block that you can use in other designs? If so, how hard would it be to make a single COG symbol file?

    If you have converted your .v or .vhdl or anything to .bsf block symbol file, you have a block symbol you can use in the graphic editor. And, yes, it is a block you can add to your design.
    We can make a block from a cog, a hub, etc - any entity can be a block - and then connect them in the quartus graphic editor instead of doing this in a top AHDL or other text description file.
  • TubularTubular Posts: 4,702
    edited 2014-08-07 23:13
    pik33 wrote: »
    I built and preliminary run it on DE1-SoC. Cyclone V has ALMs instead of LEs. ~7900 C5 ALMs vs ~16000 C4 LEs. It should run 1.5x faster with Cyclone V (150 MHz? its internal memory can work >300 MHz and PLLs >600 MHz), but I will have no data until I solve a lacking PropPlug problem. (maybe today)

    Pik33 how are we going to solve this ongoing PropPlug issue for you? Did you make up and try the transistor / rs232 circuit? That should work. Failing that, do you have any other FTDI based USB to serial modules in any form? Or CP2102's or something? Anything?

    Both the BeMicro and the DE0 have FT245's on them, for their usb interface. It would be really useful to be able to use these for communications, post altera programming, like we often do with prop plugs. I don't know whether this is possible, but if it was it would lower the barrier for all of us (well those without spare propplugs anyway).
  • roglohrogloh Posts: 5,795
    edited 2014-08-07 23:45
    Tubular wrote: »
    Pik33 how are we going to solve this ongoing PropPlug issue for you? Did you make up and try the transistor / rs232 circuit? That should work. Failing that, do you have any other FTDI based USB to serial modules in any form? Or CP2102's or something? Anything?

    Both the BeMicro and the DE0 have FT245's on them, for their usb interface. It would be really useful to be able to use these for communications, post altera programming, like we often do with prop plugs. I don't know whether this is possible, but if it was it would lower the barrier for all of us (well those without spare propplugs anyway).

    Yeah I know what you mean, and they don't seem to show the FT245 connections on the corresponding schematics which is a pity. I suspect it might be just for some JTAG bitbanging. Maybe they think that's their secret sauce! LOL.
  • pik33pik33 Posts: 2,366
    edited 2014-08-08 02:04
    Tubular wrote: »
    Pik33 how are we going to solve this ongoing PropPlug issue for you? Did you make up and try the transistor / rs232 circuit? That should work. Failing that, do you have any other FTDI based USB to serial modules in any form? Or CP2102's or something? Anything?

    Both the BeMicro and the DE0 have FT245's on them, for their usb interface. It would be really useful to be able to use these for communications, post altera programming, like we often do with prop plugs. I don't know whether this is possible, but if it was it would lower the barrier for all of us (well those without spare propplugs anyway).

    I am solving this right now. DE2-115 has RS232 input. I only need an RS232 cable with DTR (done), RS232 port on mainboard (there is one) connected to a DB9 slot (I am connecting this right now) and some verilog code to make a reset pulse for the Propeller (as soon I connect all of this RS stuff)
  • pik33pik33 Posts: 2,366
    edited 2014-08-08 02:56
    Propeller chip version 1 found on COM1 :smile:


    Without a propplug. All you need is an RS232 female(PC)-male (DE2-115) cable with pin connection 2-2, 3-3, 4(PC)-7(DE2-115), 5-5

    Pulse circuit was not needed, I simply connected UART_RTS to RESn

    Let's start playing now and check if it is programmable... :)

    First... simply connect some LEDS to some Px and blink them in Spin :)
  • David BetzDavid Betz Posts: 14,516
    edited 2014-08-08 03:19
    pik33 wrote: »
    If you have converted your .v or .vhdl or anything to .bsf block symbol file, you have a block symbol you can use in the graphic editor. And, yes, it is a block you can add to your design.
    We can make a block from a cog, a hub, etc - any entity can be a block - and then connect them in the quartus graphic editor instead of doing this in a top AHDL or other text description file.
    Thanks for the explanation. So this only has to do with using blocks in the graphical editor? If I do all my work in .v files I won't need symbol files?
  • pik33pik33 Posts: 2,366
    edited 2014-08-08 03:23
    David Betz wrote: »
    Thanks for the explanation. So this only has to do with using blocks in the graphical editor? If I do all my work in .v files I won't need symbol files?

    Yes, but I don't know how to connect a AHDL propeller to anything in Verilog. I used to write my modules in verilog, then convert them to blocks and connect them in the graphical editor. It is then easy readable.Blocks can be nested, you may make a big block from some small ones.


    And the LED blinks!
    The circuit in the picture.
    The strange code used for blinking, copied from my first prop experiments:
    con delay=40000
    
    
    pub start
    coginit (1,@proc,delay)
    
    dat
    
    proc    mov 489,#1
            or dira,489
    
    loop3   mov 490,par
            shl 490,#4
            mov 489,#1
            mov outa,489
    loop    djnz 490,#loop
            mov 489,#0
            mov outa,489
            mov 490,par
            shl 490,#4
    loop2   djnz 490,#loop2
    
            jmp #loop3
    
    
    1024 x 371 - 93K
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-08-08 03:45
    Victory!!!!

    I'm going to try and follow your example and build a P1 Block. Not sure why at this point other than it will be good hands on experience working with the tools and Verilog and that's what I need right now. I like your idea of having the blocks to link together especially with all the extra goodies on the DE2.

    PM me if you are interested in a PropPlug - I'm sure I have an extra floating around some place. This way you can experience the best of both worlds! Postage to Poland for a small envelope with "gift" on the customs label can't be all that terrible.
  • pik33pik33 Posts: 2,366
    edited 2014-08-08 03:58
    Now time to try and recerate a Propeller demo board in DE2-115 and then run my SID/WAV player in it :) The audio will need some work, the driver for audio chip needs to be written but then we will have real 24-bit audio codec running.

    To do :)

    ... edit... and EEPROM.... there is a eeprom on DE2-115 but it is too small for a prop Maybe it will be possible to write an EEPROM emulator using a flash chip.Or maybe simply buy a 40 pin connector, prototype board and put an real eeprom on it.
  • pik33pik33 Posts: 2,366
    edited 2014-08-08 04:09
    mindrobots wrote: »
    Victory!!!!

    I like your idea of having the blocks to link together especially with all the extra goodies on the DE2.

    .

    And we can then put more than one prop on the design.
  • overclockedoverclocked Posts: 80
    edited 2014-08-08 12:54
    For a guy that handles both Xilinx and Altera FPGA-boards it does not seem optimal to build any other files than verilog as part of the main suite. There have been talk of separating files into core-stuff and vendor/board specific files. I think the goal should be to get as few files as possible in the upcoming specific-folders and as much as possible in the core-folder. What do you guys think? Nothing stops vendor-specific files, but I rather see that all AHDL/TDF was being converted to standard verilog. And yes, I can do it! :-) I'll actually try to start porting the project this weekend and share the end result if anybopdy is interested.
  • Heater.Heater. Posts: 21,230
    edited 2014-08-08 13:28
    overclocked,

    I have no idea what you are talking about in detail, not having ever used any HDL or FPGA before, but it sounds like you are making sense.

    The sources as released already look like a mess to me as we have two directories of verliog for two different Altera devices/boards with the same Propeller verilog files in both (At least by name if not content). Presumably most of that verilog is the same but some of it is tweaked for the different platforms. I have no idea what the differences are as I have not done a diff on the files yet.

    Even without knowing anything about anything this does not look good and clearly does not scale to many platforms and potentially many patches and fixes by many people.

    Clearly this needs splitting up into the essential Propeller components and a variety of top level adaptions/configurations for the different platforms that might be used. Whilst we are at it the PASM source code of the interpreter and other bits should be in it's own source directory rather than sitting around at the top level.

    If someone who knows how to organize a verilog tree like that for use across Altera, Xylinx and whatever other tools could do that it would be great.

    I have the Propeller files on github here: https://github.com/ZiCog/P8X32A_Emulation

    In the absence of any better organization you could fork and hack on that. Not that I have any desire to become a P8X32A_Emulation maintainer. (At least my repo has the tabs removed to fix the broken verilog formatting and make it readable :) )
  • pik33pik33 Posts: 2,366
    edited 2014-08-08 22:17
    For a guy that handles both Xilinx and Altera FPGA-boards it does not seem optimal to build any other files than verilog as part of the main suite. There have been talk of separating files into core-stuff and vendor/board specific files. I think the goal should be to get as few files as possible in the upcoming specific-folders and as much as possible in the core-folder. What do you guys think? Nothing stops vendor-specific files, but I rather see that all AHDL/TDF was being converted to standard verilog. And yes, I can do it! :-) I'll actually try to start porting the project this weekend and share the end result if anybopdy is interested.

    Clear verilog top file is of course the best.
    Making a symbol file from it is a matter of seconds and it can run on xilinx too.
  • potatoheadpotatohead Posts: 10,261
    edited 2014-08-08 22:51
    Heater's suggestion seconded.
  • overclockedoverclocked Posts: 80
    edited 2014-08-09 01:03
    OK I quickly used WinMerge for a directory diff. Here's the result:
    3 interesting files is diffferent:

    hub_mem.v - only differ by one line, the commented out char-ROM
    top.qsf - Different FPGA device specified and different pin assignments.
    readme.txt - well.. it mentions how to get each board up and running

    The rest of the files can be considered CORE-files.
  • pik33pik33 Posts: 2,366
    edited 2014-08-09 11:41
    Connected DE2-115 vga output to p16..p23. Run my nostalgic video driver demo. success - propeller video circuit works OK. :)
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-08-09 15:55
    For a guy that handles both Xilinx and Altera FPGA-boards it does not seem optimal to build any other files than verilog as part of the main suite. There have been talk of separating files into core-stuff and vendor/board specific files. I think the goal should be to get as few files as possible in the upcoming specific-folders and as much as possible in the core-folder. What do you guys think? Nothing stops vendor-specific files, but I rather see that all AHDL/TDF was being converted to standard verilog. And yes, I can do it! :-) I'll actually try to start porting the project this weekend and share the end result if anybopdy is interested.
    Absolutely interested. The easier it is to run on different vendor boards, the more users who already have boards can join in.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-08-09 15:57
    pik33 wrote: »
    Connected DE2-115 vga output to p16..p23. Run my nostalgic video driver demo. success - propeller video circuit works OK. :)
    Fantastic news - WTG
  • RamonRamon Posts: 484
    edited 2014-08-11 07:34
    I'll actually try to start porting the project this weekend and share the end result if anybopdy is interested.

    I am interested, I have the Spartan s3board (with 1000k gates). And I agree with your idea of board specific files.
Sign In or Register to comment.