Shop OBEX P1 Docs P2 Docs Learn Events
FPGA Forth machines — Parallax Forums

FPGA Forth machines

When I look into FPGAs for Propeller 1 or 2 replicas, I cannot help but wonder if there is any interest in creating an alternative that uses Forth  CPUs rather than Cogs that require SPIN and PASM.

My great enthusiasm for Forth on the Propeller comes about by having 8 CPUs share come i/o and a common Forth dictionary access. It just seems to me that one might completely eliminate the using PASM by providing a different kind of CPU architecture.   There already are Forth CPUs in FPGA that have proven themselves, and actually provide excellent speed performance.

I do realize that is a big fork from the current evolution from Propeller1 to Propeller2, but I am asking is it at all worthwhile and valid.
«1345

Comments

  • jmgjmg Posts: 15,173
    There is nothing stopping a design from mixing P1V COGs and ForthEngines in one FPGA.

    Even a hybrid may be possible, where the innermost loop of Forth, could become a couple of new opcodes.
    That would allow easy incremental testing. 
  • I'm sure I could tweak the P1V into supporting Forth better but for the price of a suitable FPGA and its multilayer pcb etc I think I am better off with a better CPU (vs microcontroller) in the first place which might even be cheaper than the P1 chip itself. That's kind of why I don't take a lot of interest in FPGA versions because while they are great to play with, they are not ever going to be practical for day to day designs. However I do like the idea of them as there may be that "special project" that could really benefit from it.
  • There are probably a dozen or so active forum members that I can count off hand which might take interest in something like this. Actually, that's a pretty large number considering it is Forth, after all! I'm sure a few of the P1V/FPGA/Verilog fans would join in just because it is an interesting way to use an FPGA.

    Go for it, Loopy! Grab yourself a BE Micro or a Nano-DE0 and just into the FPGA waters. Either of those should be able to support a P1VF (That would be a Propeller 1 / Virtual (Forth)) variant. I'm sure folks will jump in the pool once they see you haven't been eaten by any sharks!
  • There are probably a dozen or so active forum members that I can count off hand which might take interest in something like this. Actually, that's a pretty large number considering it is Forth, after all! I'm sure a few of the P1V/FPGA/Verilog fans would join in just because it is an interesting way to use an FPGA.

    I know I would! I found the J1 Forth verilog very interesting! While I am not a Forth programmer, I admire its elegance! A multi-Forth cpu would be neat to see!
  • If you want to do a Forth engine in an FPGA there's no reason to keep any of the cog's instruction set.  You could keep the hub architecture and replace the cogs with Forth-specific processors.  This should give you a machine that is more powerful than the P1 and executes primitive Forth words directly.
  • Well, I have been looking at various FPGAs to purchase.  The BeMicro MAX10 for about  $30USD is appealing for a first try.  It won't do the Propeller2, but it does have some interesting extras that the larger FPGAs seem to omit. 

    Hopefully, this concept doesn't offend the Propeller2 developers as it veers off in a separate direction.  We really have two potential FPGA groups with very different abilities -- Experimenters and Developers.
  • The P2 Developers is Chip. I'm pretty sure he won't be offended.I've always had teh impression he is as much for experimenting, fun and play as any of us.

    As for the Forum FPGA folks, they go off in all directions. I don't think tehy will be any more offended than running Forth on a propeller upset tehir sensibilities on any normal day.

    The BE Micro CV or Max 10 could be interesting since now there is a P1V with 2M of hub and potentially 8M of hub - that would be a glorious space for a Forth dictionary!
  • Well, I have been busy with shopping and research.

    It looks like I may have to order an FPGA from the USA to get anything up-to-date, even though there is an Arrow office just 5 minutes from my home in Kaohsiung.  Apparently, they may not have a retail inventory.

    The Nano-DE0 from Parallax is competitively priced for those of us that can't get an academic discount.  And I suppose I could add in a few other Parallax items I desired.

    While I am sorting out what to buy from the USA (shipping seems to always double my cost), I have been studying the J1 Forth article and the actual Verilog code.  I am also happy to see it is in part based on eForth, which I have studied in the past and decided I particularly liked.

    I am going slow as I do have a lot to learn about Verilog.  The more I read, the better I get an idea of what I might expect from what I buy.

  • jmgjmg Posts: 15,173
    edited 2015-07-22 03:33
    Base level  MAX 10 EVAL boards start at ~$30 and Altera emailed earlier today about a NEEK, not as cheap $373 but has a LCD touch screen.
    That targets NIOS on the 10M50, and the MAX10 MHz numbers I've seen for NIOS have been quite high.

    https://www.altera.com/products/boards_and_kits/all-development-kits.html#

    There was a hint of a ~$100 10M50 Board, but not sure where that has gone...

    Then, there is the BeCMiroCVA9 for ~ $150 with a quite grunty FPGA - that one is P2 capable.

    Depends what else you want to use the board for, in future.

    An appeal of MAX10 is there are small ones available, making something like P1 and Max10xx a Practical pairing.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-07-22 16:34
    Well, I just noticed that the MAX10 provides only about 3 Cogs with a Propeller 1 configuration, and I suspect the CV has about the same, but clocks twice as fast at 100Mhz

    So I guess I am all in for BeMicro CVA9.  Shopping FPGAs is a bit daunting.  Altera sells the chips to others that create a wide array of Development Kits, so one has to seek out an Altera partner that is aligned with one's personal goals.  Arrow Electronics and the BeMicro devices seem to be a good fit for me.  But others might be more comfortable with Parallax's own Propeller 1-2-3 board and the fact that you can talk to other users that have the same.

    ++++++++
    On the Forth side of things, I went shopping for a copy of 'eForth and Zen' by C.H. Ting, but found a lot of broken links.  So I finally went to C. H. Ting's own website and was delighted to find that I could order a copy of the book for $15 as an eBook (to be received via email).

    http://www.offete.com/library.html

    This is quite important as C. H. Ting created a version of Forth ideally suited for this FPGA application as it was limited to 32 or less machine instructions.  With the addition of a binary installed in RAM, you get very close to ANSI 83 Forth.  One needs to use this book as a reference (or he code for eForth on various platform) to actually have a complete Forth.

    Looking into the four short pages of J1 explanation, it seems a bit unclear how the full Forth language is included.   So one needs to become knowledgible of eForth via other examples.
  • Loopy, the BE Micro CV will hold a full P1V with a wee bit of room left, I believe. It was also able to run a single P2-Hot cog.

    The CV A9 should be incredibly spacious  (a great lot more than a CV) - you will be able to do much. I don't think you will be alone when it comes to forum member that have CV-A9 boards.

    Quartus II is a pig of a download, the Latest Linux .tar file is 5.9GB. I'm not sure how you are set up for bandwidth but you may want to start downloading now! :o) I haven;t looked for ALtera and Quartus but Xilinx made CDs available if you did not want to download but could wait for a CD to be delivered.

    Thanks for the link to the eForth ebook - that looks interesting and I'm sure will be added to the library very soon now.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-07-23 16:57
    Well, I flipped a coin and ended up buying both the BeMicro CV and the BeMicro CVA9.  Also got the BeMicro oscilloscope card add-on.... just ignored the coin and heaped on the goodies.

    Shipping to Taiwan was $44.00USD for all of it, and would likely have been the same for just one item.

    And on the Forth side of things, I have downloaded the Propeller 1V FPGA files which will likely be my foundation for a modified Cog CPU to target Forth Asm of some sort instead of SPIN and PASM.

    I am not 100% the J1 Forth machine is really useful for a eForth scheme to generate an ANSI Forth from 32 or less assembler instructions.  But that is exactly what I am targeting to learn.  And as a conceptual bridge, I will be relying on Dave Hein's pfth version 0.83.   I was happy studying that code in PASM before, so I am going to get back into it.

    One more shopping task, a copy of 'eForth and Zen' by C.H. Ting.  I did previously download a free version, but the file has some sort of corrupted file formating.   I have several other shorter documents by him that have been very useful, but there may come a point where the complete text is an invaluable reference.

    Lots to study and explore.
  • When you said you flipped a coin and ended up getting both, I was kind of concerned about how coins land in the southern hemisphere!!

    Based on your stories of shipping, it sounds like you chose wisely!

    There are a lots of paths to head down with the actual implementation - it will be interesting to see which route chooses you.


  • Most Forth compiled code is implemented as address words which eventually end up pointing to the actual assembly language routines. However you can't use that VM model for the Forth CPU itself, it needs to be fed opcodes just like any other processor and those opcodes in a Forth CPU are fairly short because most of the time they don't need to have source and destination addresses like the Prop does for instance. Some Forth CPUs use multiple 5-bit opcodes crammed into a longer word but that gives you an idea that there only needs to be a handful of actual opcodes and the rest can implemented as calls, preferably with minimal overhead. Tachyon is closer to this "opcode" model as for instance a DUP compiles as a single 8-bit opcode as do many other core kernel words.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-07-23 17:32
    Well, you really need to talk to an Aussie or Kiwi about southern hemisphere issues.  I am just below the Tropic of Cancer and 1 degree or so north of parts of Hawaii.

    My shopping excursions were a bit frustrating as usual.  I seem to always have to import 'the good stuff' to Taiwan, even when we have it made here and have a local office.  In this case, the Kaohsiung Arrow office is so near my home that I could kick the door in and return home in less than 3 minutes.

    But one just has to accept the global corporate way... nothing gets purchased without a few thousand miles of air travel.

    ++++++++++++
    I really don't have much of a clue about FPGAs... I am a complete novice.  But the siren call is strong and I have a gut feeling that I may have one of these two devices end up doing something very different... like cloning a MOOG synthesizer.

    They open up a lot of regions to imagination that simply pondering C and Assembler can never reach.

    But for now, a dedicated Forth CPU in a Propeller Cog, I/O, and Hub RAM scheme is foremost.
  • MJBMJB Posts: 1,235
    edited 2015-07-24 11:24
     I went shopping for a copy of 'eForth and Zen' by C.H. Ting, but found a lot of broken links.  So I finally went to C. H. Ting's own website and was delighted to find that I could order a copy of the book for $15 as an eBook (to be received via email).
    So it  seems you don't know
    http://www.wulfden.org/downloads/Forth_Resources/

    this helped me a lot when I started with FORTH on the Prop
  • So it  seems you don't know
    http://www.wulfden.org/downloads/Forth_Resources/

    this helped me a lot when I started with FORTH on the Prop


    You may need to edit the hyperlinking, it ended up with some extras as http://www.wulfden.org/downloads/Forth_Resources/http://

  • TorTor Posts: 2,010
    But one just has to accept the global corporate way... nothing gets purchased without a few thousand miles of air travel.


    One of the most absurd cases I read about was that fresh fish would be airlifted all the way from Norway to China, packed, and shipped back.. according to the newspaper which wrote about it the people involved defended the practice because it was 'cheaper'. Well, I don't buy old fish.. I don't know how something like that can work in the long run.

    -Tor
  • MJBMJB Posts: 1,235
    But one just has to accept the global corporate way... nothing gets purchased without a few thousand miles of air travel.


    One of the most absurd cases I read about was that fresh fish would be airlifted all the way from Norway to China, packed, and shipped back.. according to the newspaper which wrote about it the people involved defended the practice because it was 'cheaper'. Well, I don't buy old fish.. I don't know how something like that can work in the long run.

    -Tor


    North sea shrimps goto Marocco for pealing ... before they end up in Europe supermarkets ...
    and more such things going on.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-07-24 13:21
     I went shopping for a copy of 'eForth and Zen' by C.H. Ting, but found a lot of broken links.  So I finally went to C. H. Ting's own website and was delighted to find that I could order a copy of the book for $15 as an eBook (to be received via email).
    So it  seems you don't know
    http://www.wulfden.org/downloads/Forth_Resources/

    this helped me a lot when I started with FORTH on the Prop


    Well, www.wulfden.org certainly has a good library that I somehow couldn't locate.

    I have a copy of eForth Overview, also by C.H. Ting and that is a very very useful document -- must read status.  It provides a vision of how compact code can be.

    In any event, while I do like to save money by getting Free Downloads, C. H. Ting has contributed so much to eForth that I am more than happy to pay $15 USD for a good 2ed copy of 'eForth and Zen' directly from the author.

    STATUS --

    1. At this point the 'eForth and Zen, 2ed.' arrived in pdf format and is good to go -- even in Linux which Adobe no longer supports Adobe Reader for pdf.  I have to use the non-Adobe pdf reader.

    2. And all my stuff from Arrow Electronics seems to have cleared credit card payment and awaiting shipping and a tracking number.

    3. Downloaded a Verilog Tutorial in pdf that is a few hundred pages.

    4. Located my printout of Dave Hein's pfth ver 0.83 pasm code.

    so....  I have a lot to puzzle through, but suspect that all the elements are included if I can just figure out Forth architecture, Verilog code, and how to bridge what has already been done in Forth on the Propeller 1 into the Propeller 1V fpga code.
  • Cool! Just curious, what Verilog tutorial did you find?

    I found this on Haskell's FC16 FPGA Forth. (just something for the library)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-07-24 16:29
    I have a download copy of "Verilog Tutorial" by Deepak Kumar Tala, www.asic-world.com

    There may be others that are better. I just wanted something that I could have a downloaded pdf as reading HTML annoys me.

    I do see a reoccurring problem with Forth pdf downloads that the right margin may be clipped, so words are cut in half or missing on that margin.  If the document is short, I can usually work with it.  But for long documents it gets to be too much. 

    Sadly, "eForth Overview" in pdf at wulfden site is one that is clipped, and it is 39 pages long.  I have my own clean copy that was acquired elsewhere in  HTML and converted to PDF by myself.  Just printing directly from an online HTML is likely why the right margin problem.
  • mindrobotsmindrobots Posts: 6,506
    edited 2015-07-24 16:28
    I just downloaded the eForth overview from Wulfden and I am reading it on my Fedora 22 system using Document Viewer 3.16.1 (the standard installed PDF reader), I see maybe 1/2 letter of clipping on the right margin.

    I need to see what it looks like in an "Official" Adobe PDF reader.

    EDIT: The eForth overview document looks identical whether in official Adobe
    Reader XI or in Document Viewer. At least in the case of this document,
    the right margin is really trimmed by 1/2 character.
  • Heater.Heater. Posts: 21,230
    Try reading it with Okular. That has always worked well for me. 
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-07-24 16:42
    The clipping seems to be a problem in conversion from HTML to pdf, not an Adobe Reader issue.

    About the only frustration I have with not using Adobe Reader is the USA Treasury Department has required I file a document created in Adobe Reader and so I actually have to use a Windows or Apple systems to comply with their rather nasty law for overseas Americans.

    But it has made me wary about a coming fork in reading PDF documents.  In Linux, I get an nasty message that what should be a generic PDF requires Adobe Reader.

  • The clipping seems to be a problem in conversion from HTML to pdf, not an Adobe Reader issue.



    OK, I'm confused (as usual).

    I click on the eForth PDF at Wulfden and it opens up in my FIrefox browser as a PDF document and looks great (slight 1/2 character clipping on right). I decide I like it and want to keep a copy, so I click the save icon in the PDF document's menu bar (not the browser menu bar) and it gives me a save icon adn does its business. I click on the PDF document from where I saved it and (in my case), Document Viewer pops open in Gnome displaying the document and it looks fine.

    No place was any HTML to PDF conversion done or expected or required. It's PDF through and through.

    As for creating ADOBE only PDFs, I can't respond to that.

  • Heater.Heater. Posts: 21,230
    Where does that nasty message come from? I have yet to see it.
    Recently I had to fill in some PDF forms, what a pain. 
    I discovered I could open those forms in inkscape and add text to the form fields. It's a bit clunky but does have the side effect that you can resize the form fields to fit what you want to write into.  
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-07-24 17:41
    USA Department of Treasury forms for the Internal Revenue Service all work fine in Linux.

    But the Department of Treasury for decades has required any U.S. citizen that has overseas bank accounts or stock accounts over $10,000USD to file a form directly to them.  Two years ago, they changed from accepting the form on paper, to an automated electronic filing system that uses Adobe software to provide the form with an 'electronic signature' instead of a handwritten one.

    The new FBAR system will not provide a Linux compatible pdf after you file, only Windows or Apple OSes with Adobe Reader.

    http://www.treasury.gov/services/Pages/TD-F-90-22.1-Report-of-Foreign-Bank-and-Financial-Accounts.aspx
    http://bsaefiling.fincen.treas.gov/main.html

    The first year, I got a copy from them and printed out a copy to file.  At the time, I had to download and install Adobe Reader for Linux.

    The second year, it appears that my updating of my Linux removed the Adobe software and it was no longer available.  So when I filed this year, what I downloaded as a copy of my 'signed document' just gave me a nasty notice that my PDF was not Adobe Reader.

    To add to the bizarre... the Treasury Department allows only one download and I didn't save the file as I was flustered.  So I don't have a reference copy for my records, and they say I should refile an 'amended form' on a Windows machine to get a file copy.

    ++++++++++++++

    Regarding the HTML versions....
    It appears Wulfden downloaded originals from no longer available links or sites and converted the HTML documents there into PDF versions.... imperfectly.

    I did the same thing, then went back and download the HTMLs, opened them in OpenOffice, and reformatted to get clean PDF.

    Where are those HTML versions?  Likely gone for good.  People grow weary of maintaining low traffic websites.  And it seems that Forth is suffering from obscurity.
  • Heater.Heater. Posts: 21,230
    Wow, what a pain. So the whole deal is not about PDF forms so much as the signing part. Authentication that is, they want to know it really is you they are dealing with. Seems they have not heard their are much better ways to do that now a days. 
    I find it appalling that the US treasury has any interest in US citizens who have been living outside the US for ages, but that is another story.
    Yeah, sadly websites die all the time for all kind of reasons.  
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-07-24 18:13
    Okay, Heater...
    The topic of this thead is a  Propeller-like Forth constructed in FPGA.

    I began to mention the formating issues because getting some of the classic Forth articles is awkward.

    Regarding overseas Americans and what the USA requires of them is simply political.  And I would rather not get this thread closed by a rabid discussion of what should and should not be.

    I was merely dumbfounded by Adobe Reader pulling out of Linux and being involved in creating some sort of new PDF that won't work in Linux.  We may find in the future that sharing some documents in PDF will actually require proof of identity to be able to read.

    ++++++++++
    Enough said, please let this thread live for its original goals.
Sign In or Register to comment.