Author Topic: Programming Lattice FPGAs on a Mac?  (Read 11173 times)

0 Members and 1 Guest are viewing this topic.

Offline mr_darkerTopic starter

  • Contributor
  • Posts: 14
  • Country: us
Programming Lattice FPGAs on a Mac?
« on: November 13, 2018, 05:34:56 pm »
Anyone out there using a Mac for Lattice FPGAs?
Are there Mac alternatives for Lattice's Diamond IDE?
I've never used one before and don't know of any other IDEs for FPGAs.  Tried looking up 'open source FPGA IDE' and 'lattice diamond mac alternative' but didn't find anything.  Am I doomed to find a windows PC?

Looking to start messing around with my xo3 evaluation board, get acquainted with VHDL, the xo3 architecture, and hopefully soon use it in a design.


Side question:  Making an array of FPGAs, an array of arrays, aka a bigger array.  Anything wrong with doing that to get bigger FPGAs for less money?  (comparing Logic Blocks per dollar)
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14466
  • Country: fr
Re: Programming Lattice FPGAs on a Mac?
« Reply #1 on: November 13, 2018, 06:09:17 pm »
Not that I kow of. There are Windows and Linux versions.
You can always run either of those on a virtual machine on your Mac instead of resorting to use a PC.

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Programming Lattice FPGAs on a Mac?
« Reply #2 on: November 13, 2018, 06:27:03 pm »
It it extremely hard to get it running even on Linux, where it is officially supported.
Alex
 

Offline joshtyler

  • Contributor
  • Posts: 36
  • Country: gb
Re: Programming Lattice FPGAs on a Mac?
« Reply #3 on: November 13, 2018, 08:20:09 pm »
Side question:  Making an array of FPGAs, an array of arrays, aka a bigger array.  Anything wrong with doing that to get bigger FPGAs for less money?  (comparing Logic Blocks per dollar)

If you have what is essentially a monolithic design, that you intend to partition between FPGAs, you are creating a world of hurt for yourself! Whilst what you describe is technically feasible, you will have to partition your design into independent chunks with a minimal interface between chips which you define at the time of board creation (or at least define the number of pins and IO standard at board creation time). In addition it means that the partitions of your design have to have a roughly even split in terms of resource usage, which often is not the case. Not to mention the fact that you now have multiple designs to implement, multiple designs to meet timing on, multiple chips to program, each time you change your code, making your iteration time vastly greater. Assuming that you value your time, then you are likely better off buying the larger FPGA.

Having said that, if you have the same design which you want to replicate multiple times (one instance per FPGA) then the approach you describe makes a lot of sense. It could also make sense if your design consisted of several largely independent blocks with a simple and well defined interface. (E.G. You have a video processing system, which feeds into a video encoder, and the interface between the two is just a pixel stream). You would likely be best off using a high speed serial interface (with an FPGA that has appropriate gigabit transceivers)  between the FPGAs if you need high data throughput.
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2732
  • Country: ca
Re: Programming Lattice FPGAs on a Mac?
« Reply #4 on: November 13, 2018, 08:33:08 pm »
Side question:  Making an array of FPGAs, an array of arrays, aka a bigger array.  Anything wrong with doing that to get bigger FPGAs for less money?  (comparing Logic Blocks per dollar)
In short - forget it. It might work for some corner cases, but in general having one large FPGA is eons better than a bunch of smaller ones.

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Programming Lattice FPGAs on a Mac?
« Reply #5 on: November 13, 2018, 11:35:30 pm »
Not that I kow of. There are Windows and Linux versions.
You can always run either of those on a virtual machine on your Mac instead of resorting to use a PC.

I run Lattice Diamond in a Windows 7 VM on my Macs and the software works as expected. I can even program the chips with the HW-USBN-2B. No problems.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Programming Lattice FPGAs on a Mac?
« Reply #6 on: November 13, 2018, 11:38:30 pm »
Anyone out there using a Mac for Lattice FPGAs?

I do. I run a Windows 7 VM in VMWare Fusion. It all works, even the USB programmer.

Quote
Side question:  Making an array of FPGAs, an array of arrays, aka a bigger array.  Anything wrong with doing that to get bigger FPGAs for less money?  (comparing Logic Blocks per dollar)

The interconnect between the various FPGAs will kill you. They'll kill you because of PCB routing congestion, they'll kill you because I/O speeds are usually slower than internal clock rates (use the PLL to bump you clock up), they'll kill you because of power consumption, they'll kill you because programming the FPGAs with JTAG means either a large JTAG chain or multiple JTAG connectors.
 

Offline aandrew

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: ca
Re: Programming Lattice FPGAs on a Mac?
« Reply #7 on: November 20, 2018, 04:31:30 am »
It it extremely hard to get it running even on Linux, where it is officially supported.

Why do you say that? Perhaps I can help shed some light. I have the ICE40 stuff working on an Ubuntu VM that I'm accessing using xrdp (so I can just use any RDP client, my fave is Jump Desktop). The GUI works pretty much exactly the same as on Windows (and is considerably more archaic than the more popular Lattice Diamond or whatever they call the latest incarnation for their MachXO devices).

What I wish was for better command line documentation. I've been trying to get a decent set of CLI commands so I can do away with the GUI and just build with a small Makefile.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Programming Lattice FPGAs on a Mac?
« Reply #8 on: November 20, 2018, 04:36:22 am »
and is considerably more archaic than the more popular Lattice Diamond or whatever they call the latest incarnation for their MachXO devices
Ok, I was talking about Lattice Diamond. I did not know they had a different IDE for ICE40. But even if it is the case, the original question was about Diamond.

And unlike Altera and Xilinx stuff, you have to work to make it work.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Programming Lattice FPGAs on a Mac?
« Reply #9 on: November 20, 2018, 05:26:04 am »
Well, I just tried to install iCEcube2 and it fails to recognize the host ID. Their official FAQ suggests renaming networking interface to "eth0", since that what is hard coded in their license check. And the solution is to edit udev rules to rename the interface. F that. They can keep their quality enterprise software.

Why they insist on using that abomination of a license manager for free licenses is beyond me.
« Last Edit: November 20, 2018, 05:52:39 am by ataradov »
Alex
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9015
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Programming Lattice FPGAs on a Mac?
« Reply #10 on: November 20, 2018, 06:07:44 am »
Micah Elizabeth Scott did a bit of ICE40 FPGA programming on a Mac, probably worth checking exactly how she did it.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Programming Lattice FPGAs on a Mac?
« Reply #11 on: November 20, 2018, 06:09:50 am »
Micah Elizabeth Scott did a bit of ICE40 FPGA programming on a Mac, probably worth checking exactly how she did it.
Yes, I've seen the streams. I'm waiting for the CrowdSupply campaign for that board she used. I know I can probably use some standard dev kit, but I'm in no hurry at the moment, but I will definitely investigate that toolchain.
Alex
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Programming Lattice FPGAs on a Mac?
« Reply #12 on: November 20, 2018, 06:16:04 pm »
Why they insist on using that abomination of a license manager for free licenses is beyond me.

That applies to ALL OF THE FPGA VENDORS.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Programming Lattice FPGAs on a Mac?
« Reply #13 on: November 20, 2018, 06:19:57 pm »
That applies to ALL OF THE FPGA VENDORS.
I'm not sure if Intel has removed it or jut made it totally seamless, but Quartus just works for me. I know I had to deal with it in the past with Xilinx as well, and when time came for a new FPGA project, I just went with Altera.
Alex
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Programming Lattice FPGAs on a Mac?
« Reply #14 on: November 20, 2018, 06:44:02 pm »
That applies to ALL OF THE FPGA VENDORS.
I'm not sure if Intel has removed it or jut made it totally seamless, but Quartus just works for me. I know I had to deal with it in the past with Xilinx as well, and when time came for a new FPGA project, I just went with Altera.
I have not looked at Altera in a couple of years, so I don't remember. Maybe Intel "Saw the light!" I've been in Microsemi (now Microchip) land for a couple of years so I haven't kept up on Brand A and Brand X.

Here's a funny thing. The Microsemi fitter takes a long time to chug through my current design, and to get it to meet timing i need to do the multiple-runs thing. I thought it might be interesting to run the tools on Linux to see if there was any significant difference in performance. My computer, a Dell quad Core i7 of some sort, already had a spare hard drive inside that I was using for backup, so I decided to install the most recent CentOS (recommended by Microsemi) on it. That went OK, and I installed the Microsemi tools and tried to run them. Oh no, you need to download and install all of these other depedencies! Was I asked about installing those dependencies when I installed Linux? Not that I remember! Are these dependencies easy to install? Of course not!

So I finally got the dependencies installed and went to launch Libero. Oh shit, forgot about the license nonsense. Get this: in order to run their free software, it wanted to me to install a license server.

That's when I gave up and rebooted back into Windows 7.

I still don't understand why these companies all keep fucking with trying to get their software to run on Linux when they could choose a much more stable Unix variant that most people agree "just works" -- macOS.
 

Offline aandrew

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: ca
Re: Programming Lattice FPGAs on a Mac?
« Reply #15 on: November 20, 2018, 08:25:08 pm »
Well, I just tried to install iCEcube2 and it fails to recognize the host ID. Their official FAQ suggests renaming networking interface to "eth0", since that what is hard coded in their license check. And the solution is to edit udev rules to rename the interface. F that. They can keep their quality enterprise software.

Yes, that is a problem. The Great Network Interface Renaming threw a lot of wrenches into the gears.

What I did was to disable the new system. Basically adjust the kernel command line parameters to include "net.ifnames=0" and "biosdevname=0". For the GRUB bootloader, you find GRUB_CMDLINE_LINUX in /etc/default/grub.conf and change it thusly:

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

and run update-grub and then finally reboot.  You can also do it through udev rules but this works well enough for me. It's not intuitive, but then again hardly anything about Linux is. :-)

Quote
Why they insist on using that abomination of a license manager for free licenses is beyond me.

licenses for dev software is one of the most stupid things I've ever run across in this industry. Most of the tools are free anyway, so why bother with the licenses? paying for IP cores and licensing it to the PC is perhaps a good argument, but is still easy to work around and just causes trouble due to bad assumptions such as "the first network interface is always named eth0".  >:(
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Programming Lattice FPGAs on a Mac?
« Reply #16 on: November 20, 2018, 09:09:39 pm »
Yes, that is a problem. The Great Network Interface Renaming threw a lot of wrenches into the gears.
Only in the gears of poorly written software.

I know how to change the name of the interface, I'm just not going to do that.
Alex
 

Offline mr_darkerTopic starter

  • Contributor
  • Posts: 14
  • Country: us
Re: Programming Lattice FPGAs on a Mac?
« Reply #17 on: November 20, 2018, 09:27:17 pm »
Thanks for the advice!  I just decided to stop being lazy and finally invest time to get my netbook that's got ArchLinux on it going and usable, so it's running Diamond now.


Side question:  Making an array of FPGAs, an array of arrays, aka a bigger array.  Anything wrong with doing that to get bigger FPGAs for less money?  (comparing Logic Blocks per dollar)

If you have what is essentially a monolithic design, that you intend to partition between FPGAs, you are creating a world of hurt for yourself! Whilst what you describe is technically feasible, you will have to partition your design into independent chunks with a minimal interface between chips which you define at the time of board creation (or at least define the number of pins and IO standard at board creation time). In addition it means that the partitions of your design have to have a roughly even split in terms of resource usage, which often is not the case. Not to mention the fact that you now have multiple designs to implement, multiple designs to meet timing on, multiple chips to program, each time you change your code, making your iteration time vastly greater. Assuming that you value your time, then you are likely better off buying the larger FPGA.

Having said that, if you have the same design which you want to replicate multiple times (one instance per FPGA) then the approach you describe makes a lot of sense. It could also make sense if your design consisted of several largely independent blocks with a simple and well defined interface. (E.G. You have a video processing system, which feeds into a video encoder, and the interface between the two is just a pixel stream). You would likely be best off using a high speed serial interface (with an FPGA that has appropriate gigabit transceivers)  between the FPGAs if you need high data throughput.

There is no single chip that comes anywhere near the amount of hardware that I am aiming for.  Currently the plan is to make little "modules" containing like 25 or 100 FPGAs on each, and some ROM on the other side of each FPGA (saves on BGA routing if the pitch is similar, just going straight through).  This scales the hardware and ROM equally.  I want to make a linux kernel set up for FPGA computing, no processors.  As far as I know, FPGA computers are only novelty video game systems, the only serious attempt i've found is COPACOBANA (which uses multiple FPGAS btw) which is meant for encryption cracking and doesn't really count as it has no operating system.  I know it's a massive project likely, years long probably, and it's gonna be way more expensive in hardware to match a CPU.  But ima do it anyways, if I can.  Rather than allocating time on a processor core for processes, I intend to make a kernel that allocates HARDWARE for processes (and probably needs a hardware equivalent of virtual memory mapping).  Starting out i've selected a FPGA that has nonvolatile-instant-on-background-reconfigurable configuration memory, as this takes care of a lotta FPGA issues, eventaully tho there's an FPGA that I'd like to migrate to that doesn't have these features, but has the most bang per buck in terms of hardware.  A processorless reconfigurable computer is what i'm aiming for, bigger things later lol.
Learned linux programs are mostly all distributed with source code, which makes me feel like there's a way to compile everything in a way optimized for FPGAs, rather than run a softCPU for anything that wasn't designed to be run on an FPGA.  "We'll get there when we get there"

The FPGA i'm starting out with is the Lattice MachXO3L (the version with flash memory isn't a good fit due to the 100k cycle life of the flash memory, it'd not last long being used as ram in a computer).  Eventually, I feel switching to their ECP5 chips would offer the most bang for your buck, aka, make it the cheapest to scale the computer's power up, imagine there's no limit on how much power we need, so you just want the cheapest.

Knowing little about FPGAs, having never programmed one, am i horribly wrong anywhere?  Any major issues i'm not seeing?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11248
  • Country: us
    • Personal site
Re: Programming Lattice FPGAs on a Mac?
« Reply #18 on: November 20, 2018, 09:32:07 pm »
There is no single chip that comes anywhere near the amount of hardware that I am aiming for.
Are you sure? 100 of MachXO3L will probably be covered by a single high-end Xilinx device.

Learned linux programs are mostly all distributed with source code, which makes me feel like there's a way to compile everything in a way optimized for FPGAs, rather than run a softCPU for anything that wasn't designed to be run on an FPGA.
This is a strange statement. Even if you have the code, you can't just magically compile for "FPGA". You still need something that will sequentially execute instructions, since that's what high level programming languages map to. Xilinx is trying some  compile C into hardware thing, but it is a very different story.

Knowing little about FPGAs, having never programmed one, am i horribly wrong anywhere?  Any major issues i'm not seeing?
Make a board with just one and play with it first. You will then have realistic understanding if what FPGAs can and can't do.

Realistically you can interconnect 6-8 high end FPGAs on a single boards, but they are already sold a finished products, and it is cheaper to buy one.

With a 100 chips you will go mad ensuring signal integrity and writing constraints files.
« Last Edit: November 20, 2018, 09:35:36 pm by ataradov »
Alex
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13746
  • Country: gb
    • Mike's Electric Stuff
Re: Programming Lattice FPGAs on a Mac?
« Reply #19 on: November 20, 2018, 09:40:32 pm »

licenses for dev software is one of the most stupid things I've ever run across in this industry. Most of the tools are free anyway, so why bother with the licenses?
My guess is that they have to pay for at least some of the components - just look at how many different names appear in copyright messages when you do a compile.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Lattice FPGAs on a Mac?
« Reply #20 on: November 21, 2018, 12:06:16 am »

As far as I know, FPGA computers are only novelty video game systems, the only serious attempt i've found is COPACOBANA (which uses multiple FPGAS btw) which is meant for encryption cracking and doesn't really count as it has no operating system. 


You need to take a step back and truly understand what you get in an FPGA.  You get logic, boxes and boxes of logic chips.  Millions of flip-flops and a similar number of multiplexers.  You get no 'computer' at all!  If there is to be some kind of general purpose computing, you need to create a 'soft core' - some kind of CPU.

There are some CPU cores that will run Linux and, of course, there are Z80 cores that will run most of the early arcade games.  And 6502 cores and lots of PDP-11 projects.

Quote

Starting out i've selected a FPGA that has nonvolatile-instant-on-background-reconfigurable configuration memory, as this takes care of a lotta FPGA issues,


Like what?  The non-volatile chips tend to be small, the bigger chips all use some form of EEPROM storage for the bitstream.  In addition, the EEPROM can contain initial memory contents and, in some cases, multiple images.

Quote

Knowing little about FPGAs, having never programmed one, am i horribly wrong anywhere?  Any major issues i'm not seeing?

In my view, you are attributing capabilities to FPGAs and compilers that simply don't exist.  We can use C to describe hardware (I have never done it, I use VHDL) but when we want to start running application code, there needs to be some kind of processor to run it.  Unless the application can be fully described in hardware.  Maybe it can...


 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9015
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Programming Lattice FPGAs on a Mac?
« Reply #21 on: November 21, 2018, 04:17:42 am »
I still don't understand why these companies all keep fucking with trying to get their software to run on Linux when they could choose a much more stable Unix variant that most people agree "just works" -- macOS.
Because you want a nice machine to run that sort of software, preferably one that's not crazy overpriced for how well it performs.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Programming Lattice FPGAs on a Mac?
« Reply #22 on: November 21, 2018, 05:29:48 am »
I still don't understand why these companies all keep fucking with trying to get their software to run on Linux when they could choose a much more stable Unix variant that most people agree "just works" -- macOS.
Because you want a nice machine to run that sort of software, preferably one that's not crazy overpriced for how well it performs.

While Macs are expensive for what you get, the cost of the PC is peanuts compared to the cost of the engineer developing the HDL so I doubt the cost is really an issue. More likely it's a historical matter, FPGA development was being done on Windows PCs and Unix workstations back when the Mac was a niche product used in schools and graphic arts. By the time we had a Unix-based Mac OS, standard PC hardware running Windows or Linux was already entrenched. You don't see a lot of Macs in any kind of hardware design, there isn't much CAD/CAM/EDA/FPGA stuff for MacOS and with the direction Apple is going, I don't see that changing any time soon. My work issued laptop is a Macbook Pro and it's a nice machine for what I use it for, however to call it "Pro" is a joke. With the RAM and storage soldered to the motherboard, the only ports on it are USB-C, it wouldn't be my choice for hardwre development either. Apple is focused almost entirely on mobile devices.
« Last Edit: November 21, 2018, 05:00:23 pm by james_s »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Programming Lattice FPGAs on a Mac?
« Reply #23 on: November 21, 2018, 04:45:44 pm »
Apple used to make it darn near impossible to develop software for their machines.  Back in the very beginning, if you wanted to write code for the brand new Mac 128k, you had to get their permission and buy a Lisa machine to do it.  And a Lisa cost $10,000 in those dollars.  So, a lot of us lost interest and have never came back.  To this day, I don't and won't own Apple products.

I don't know how software development for Apple is today.  I know it is a little awkward for iOS but it is possible to independently develop software.

macOS has about 10x the percentage of desktops (nearly 14%) as Linux (about 1.6%) so, all else being equal in terms of stumbling blocks, you would think that everybody would pick macOS for their second release and just kiss off Linux altogether.  At 84%, Windows is a given!

http://gs.statcounter.com/os-market-share/desktop/worldwide/

But I don't know if 'all else being equal in terms of stumbling blocks' applies to macOS but it represents 10x more machines than Linux.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Programming Lattice FPGAs on a Mac?
« Reply #24 on: November 21, 2018, 05:06:22 pm »
The Mac 128k came out nearly 35 years ago, it's a bit silly to compare current Apple products with that, the current offerings have nothing in common with the 68k generation. There is no particular challenge to developing software for OSX, it's BSD Unix under the skin afterall. I think the percentage of Linux desktops in the hardware design field is probably quite a bit higher than in elsewhere in tech though. Originally most of the FPGA software was written for Unix workstations and Linux started taking over that area before OSX was a thing. The software was ported to Windows because the vast number of Wintel machines out there made this an obvious choice.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf