element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Role for FPGA or CPLD with Raspberry Pi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 143 replies
  • Subscribers 682 subscribers
  • Views 21399 views
  • Users 0 members are here
Related

Role for FPGA or CPLD with Raspberry Pi

michaelkellett
michaelkellett over 13 years ago

Interesting - we obviously move in rather different circles despite being in the same business:

 

Take the current project:

 

One master processor (ARM Cortex M4 with ARM serial debugging port and 4 wire trace, Ethernet, USB and serial for debugging)

One supervisor processor (ARM Cortext M0 with ARM serial debugging port)

FPGA with JTAG port

Up to 6 slave processors (ARM Cortex M4s with ARM serial debugging ports)

All in one little box about 25cm x 160cm x 5cm

 

Now to bring up the Ethernet on the master processor I can use its serial port for "printf" error messages (from the Ethernet/TCP/IP library) and the ARM debugging port to load/run/trace the processor. The ARM trace interace box (Keil Ulink Pro) is a USB interface to the development PC.

The superivisor processor is connected via another Ulink to another PC.

The FPGA JTAG interface is USB to yet another PC.

The fourth PC runs Wiresharc and is connected by Ethernet to see what's coming out.

 

It would be nice if the debug tools had Ethernet rather than USB interfaces but they don't.

I could isolate the serial debug port but since I must have three other non-isolated connections it's not worth the effort.

 

This system is all quite low power - so certainly safe to humans and fairly safe to computers. (The really exposed parts are the debug interfaces and there is nothing to be done about that since they need fast conenctions to the hardware.)

In the last 10 years I've lost one debugger and one PC due to my mistakes and in the same time at least 10 PCs have just died (as they do) so it's a cost effective approach.

 

Of course when these things connect to external systems handling real power different rules apply.

 

(AFIK most Ethernet interfaces are not specifically tested for mains safety - either during qualification or as part of normal regular safety checks (and the flash test requirement for Ethernet magnetics is 1500V AC which is OK for some equipment but not for all)).

 

Michael Kellett

  • Sign in to reply
  • Cancel
Parents
  • morgaine
    morgaine over 13 years ago

    On DesignSpark:

     

    • TAUTIC - CPLD Development Board Review
    • http://www.designspark.com/content/tautic-cpld-development-board-review

     

    The red board connected to the black CPLD header is the Bus Pirate he mentions.  I've got one of those, and they're very handy little gadgets.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 13 years ago in reply to morgaine

    At that CPLD size, I'd just go with a Xilinx XC9572XL-10TQ100CXC9572XL-10TQ100C in a 44-pin PLCC, which plugs into a PLCC socket, which in turn plugs into a wire-wrap socket or socket strips.  For some reason, I've often found 72 macro-cells to be just enough and 64 macro-cells to be "not quite enough".  XC9500XL are even older than Coolrunner-II, but they're still listed on the top CPLD page at Xilinx.com.

     

    Edit: it seems someone changed my reference to the 9572XL into a full part number including -10TQ100C.  I don't mind, except that the TQ100C is the 100-pin TQFP package.  If you want to wire-wap, you'll need the 44-pin PLCC version which is XC9572XL-10PCG44C.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 13 years ago in reply to johnbeetem

    @John,

     

    I don't advocate breadboarding as a cost effective way of designing complex logic for commercial purposes but it is still a good way to learn. Simulating on paper and  implementing with physical parts teaches many lessons - not the least of them that thinking before doing can save a lot of time. Although many of my designs use FPGAs I still use gate level logic chips from time to time - it isn't the past yet.

     

    @Roger,

     

    I was teasing you of course and happy to learn the Dutch way of saying it !

    I agree that the vendor systems do seem very bloaty - I use Aldec HDL for design/simulation (about 300Mbyte install image) and Lattice Diamond for synthesis/debugging (2Gbyte zipped install image). There is a lot of overlap - Diamond actually includes a version of the Aldec tool and the Aldec tool loads up its own versions of the Lattice libraries.

     

    I find the Lattice toolset to be the easiest to use (which might just be familiarity) of the vendor tools I've tried - it's certainly no more daunting to use than running Linux !

     

    Michael Kellett

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 13 years ago in reply to michaelkellett

    Michael Kellett wrote:

     

    With regard to open source tools - as far as I can tell there aren't any worth using and the tools from the FPGA vendors need big computers to run, Linux is no problem but you need lots of RAM and lots of hard disk.  No one in their right mind would want to run a VHDL simulator...  So we may as well accept the world as it is, and right now that means FPGA simulation and compilation on a PC or MAC.

     

    Digital CAD tools, including FPGAs, used to be my main research area a couple of decades ago.  I ran into a lot of really smart people who could have done amazing things with FPGA tools and FPGA applications if they hadn't been locked out by the vendors.  Sure, you can create generic algorithms and architectures and publish papers about them, and even get tenure doing such things, but it's nowhere as much fun as making things that really work so the kinds of visionaries who need that thrill will quite simply work on something else.

     

    Xilinx does a good job with their tools, and with skill you can write Verilog that will produce hardware that's reasonably close to what you want.  OTOH, if you make a minor change to the Verilog and suddenly the tools want an extra 20 LUTs, good luck trying to track down what the synthesizer did.

     

    I once asked an obnoxious question at an FPGA workshop related to whether it's a good idea for a silicon vendor to insist that you only use their tools.  I asked the group "How many of you have used an Intel processor?"  (Everybody raised their hands.)  Then I asked "How many of you have used an Intel compiler?"  (Maybe one or two hands -- who remembers PL/M?)

     

    In terms of accepting the world as it is, I'll quote GBS:

    George Bernard Shaw wrote:

     

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself.  Therefore all progress depends on the unreasonable man.

     

    ... or unreasonable woman, of course.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 13 years ago in reply to michaelkellett

    Michael Kellett wrote:

     

    @Roger,

     

    As you protest that an open source FPGA design toolset would be so much better than the efforts made by several different teams of pretty good people in the FPGA industry I'm reminded of  a passage from Jane Austen's Pride and Prejudice:

     

    During a discussion about playing the piano, Lady Catherine remarks, “If I had ever learnt, I should have been a great proficient.”

     

    Nice quote!  But the FPGA lockout reminds me of two lines from Tom Lehrer's "Whatever Became of Hubert":

    Tom Lehrer sang:

     

    Second fiddle's a hard part, I know,

    When they don't even give you a bow.

    For the record, I'm not saying open source tools would have better quality than vendors' tools.  I'm saying opening the programming bit streams would open up new applications (such as seriously-reconfigurable computing) and allow far more people to learn about FPGAs and become proficient in using them, resulting in far more FPGA chips being sold.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 13 years ago in reply to johnbeetem

    In any event, my question was prompted by a much less ambitious goal, a desire to have (and to help in developing) an open source EDA tool that is able to read, design for, and program some elementary programmable logic device, no matter how old and basic, as log as it's still being manufactured and sold.  That's a far cry from other worthy goals like better quality than vendors' proprietary software or less bloaty or more efficient.

     

    Nevertheless, it would be a start, and at least for some small projects and for some types of education, I'm sure that such open tools would be perfectly adequate, no matter how unimpressive the target device.  And from small seeds can grow impressive trees.

     

    But to do that, one first has to identify some openly documented target device, and it seems that our list of possible candidates is empty at this point.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • rew
    rew over 13 years ago in reply to morgaine

    read: http://lekernel.net/fpga_toolchain_talk.pdf

    Some attempts have been made. I found several links to ulogic.com which was said to have reverse engineered a xilinx bitstream. Site has vanished.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 13 years ago in reply to rew

    I doubt that there is any future in an approach that relies on reverse-engineering a bitstream format.  All it would take is a small change in the format for the company's next device and you're back to square one.  While in principle your tool would still work for the old device as long as it remains in production, it's quite a bleak prospect, with no future path.

     

    Maybe the idea is doomed until semiconductor fabrication can be done by enthusiasts / open community.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 13 years ago in reply to morgaine

    Morgaine Dinova wrote:

     

    But to do that, one first has to identify some openly documented target device, and it seems that our list of possible candidates is empty at this point.

    I've spent way too much time thinking about this over the last few days, and here are the best ideas I have so far:

     

    1.  The last time I looked, it was pretty simple to find the registers that program the "12C4" PLDs in a Cypress PSoC5, which is an ARM Cortex-M3 with an attached array of digital and analogue goodness.  (There's also an 8051-based PSoC3.)  So even if you can't figure out a way to re-program the digital interconnect, you could have a fixed routing of one or more "12C4" PLDs to the I/O pins and use the ARM to talk to a RasPi for reconfiguration and internal signal probing.  This gives you one or more PLDs, with the programmer is on the same chip.

     

    2.  As I suggested before, you could take a medium size FPGA, say a Xilinx XC3S200A, and use its LUTs as ROMs for storing logic functions and routing.  Xilinx documents how to update the contents of ROMs and registers (but not the routing).  Without a lot of effort, I think it's possible to fit in a 30-cell PLD with a simple, brute-force architecture that would permit simple tools.  Yes, you're only using a couple percent of the 200A's logic resources, but that's the nature of general-purpose computing: you spend a lot of energy getting data to the compute engines and very little doing actual computations.

     

    The idea here is that students could get started with the PLD-within-an-FPGA with simple, clean tools that don't get in the way of learning about logic.  The students who blast through this and want to make something incredible can use the same FPGA development board and Xilinx tools to do big things, but you don't have to try to teach Verilog/VHDL and the Xilinx tool chain to everybody (including the instructors).  The US$55 XC3S200A-based XuLA-200 board form XESS  looks like a promising platform.  One thing very nice about this board is that the PIC that interfaces between USB and JTAG has GPL free-as-in-liberty software, so you can talk to it from any USB host, including RasPi, instead of being digitally handcuffed to an x86 host.  And if you want to add features like probing internal registers using JTAG you can update the PIC software with new features.

     

    So there's a couple of ways to do this, and others may appear.  This means it's worth while to finish putting together that simple, clean CAD system I keep talking about.  We'll see what other platforms are ready when I have something working.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 13 years ago in reply to morgaine

    Morgaine Dinova wrote:

     

    I doubt that there is any future in an approach that relies on reverse-engineering a bitstream format.  All it would take is a small change in the format for the company's next device and you're back to square one.  While in principle your tool would still work for the old device as long as it remains in production, it's quite a bleak prospect, with no future path.

     

    Maybe the idea is doomed until semiconductor fabrication can be done by enthusiasts / open community.

    The basic problem is that the vendors see no advantage in opening up their formats to the world, and a number of disadvantages.  They like to tell prospects that their format is double-secret-has-never-been-hacked, or else prospects fear that their designs will be stolen.  However, I've heard over the decades that the bit format is not that hard to reverse-engineer.  The problem is that if you publish the results you could be sued.

     

    Now that the principal Xilinx and Altera patents have expired, maybe an Asian semiconductor manufacturer will create a line of cheap FPGAs with an open bitstream so they don't have to write tools.  The problem is that nobody will buy the parts until there are tools, and nobody will create the tools until there are parts (or at least an architecture).  If it were as cheap to make ICs as PCBs or 3-D printed thingummies, the open community could do this themselves.  Actually, it is cheap to make ICs -- just use an FPGA and the vendor's tools, so there's not really an incentive to do this.

     

    So here's my plan: make that simple, clean CAD system and target whatever I can, be it Cypress PSoC5 or PLD-within-an-FPGA.  This at least gets the tool ball rolling, and I'll have the fun of helping kids get into logic.  "Logic!  Why don't they teach Logic in these schools?" asks the Old Professor in The Lion, the Witch, and the Wardrobe.

     

    And who knows?  Maybe reverse-engineering for the purpose of using a manufacturer's product for the purpose intended by the manufacturer will become legal -- at least in some country -- and the bitstream formats will become legally hackable.  Or one minor vendor facing bankrupcy will open their format as a "Hail Mary" pass, and the others will fearfully follow.  After all, who expected Broadcom to open-source their OpenGL "driver"?  image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 13 years ago in reply to rew

    Roger Wolff wrote:

     

    read: http://lekernel.net/fpga_toolchain_talk.pdf

    Some attempts have been made. I found several links to ulogic.com which was said to have reverse engineered a xilinx bitstream. Site has vanished.

    I believe the ulogic.com site had an implementation of the work described in this paper: From the bitstream to the netlist.  Here's the key quote:

    It is widely believed that the analysis of bitstream formats is a daunting task.  In fact, it is surprisingly easy.  This paper presents a methodological approach to bitstream reversing illustrated with a case study on the Virtex FPGA lines from Xilinx.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 13 years ago in reply to johnbeetem

    John Beetem wrote:

     

    I believe the ulogic.com site had an implementation of the work described in this paper: From the bitstream to the netlist.  Here's the key quote:

    It is widely believed that the analysis of bitstream formats is a daunting task.  In fact, it is surprisingly easy.  This paper presents a methodological approach to bitstream reversing illustrated with a case study on the Virtex FPGA lines from Xilinx.

     

    Unfortunately it's a bit of a foregone conclusion that if a useful tool were ever produced after reverse-engineering the format and it gains popularity, Xilinx would respond by making their next bitstream encrypted.  And while the hardcore hackers may see that as a fun challenge, for those interested in open source engineering rather than chasing tail lights, it's a poor road to take.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • morgaine
    morgaine over 13 years ago in reply to johnbeetem

    John Beetem wrote:

     

    I believe the ulogic.com site had an implementation of the work described in this paper: From the bitstream to the netlist.  Here's the key quote:

    It is widely believed that the analysis of bitstream formats is a daunting task.  In fact, it is surprisingly easy.  This paper presents a methodological approach to bitstream reversing illustrated with a case study on the Virtex FPGA lines from Xilinx.

     

    Unfortunately it's a bit of a foregone conclusion that if a useful tool were ever produced after reverse-engineering the format and it gains popularity, Xilinx would respond by making their next bitstream encrypted.  And while the hardcore hackers may see that as a fun challenge, for those interested in open source engineering rather than chasing tail lights, it's a poor road to take.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • johnbeetem
    johnbeetem over 13 years ago in reply to morgaine

    Morgaine Dinova wrote:

     

    Unfortunately it's a bit of a foregone conclusion that if a useful tool were ever produced after reverse-engineering the format and it gains popularity, Xilinx would respond by making their next bitstream encrypted.  And while the hardcore hackers may see that as a fun challenge, for those interested in open source engineering rather than chasing tail lights, it's a poor road to take.

    Xilinx offers optionally-encrypted bitstreams in all of their latest FPGAs and some of their older high-end Virtex parts.  Since encryption is now available on all recent parts there's really no reason for Xilinx to keep the bitstream format secret.  This is particularly true of parts with built-in CPUs, since the CPU can program the FPGA from a bitstream encrypted any way the CPU's software desires, without exposing the bitstream to any external pins.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube