Author Topic: FPGA Malarkey  (Read 2128 times)

Offline Loremaster

  • Administrator
  • Maximus
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 9
  • Posts: 1549
  • No, Jum. You are the dolls.
Re: FPGA Malarkey
« Reply #15 on: March 27, 2015, 09:10:17 PM »
Good on you with numeric_std. Trying to work with std_logic_arith is easier for beginners, but because it isn't REALLY IEEE it causes headaches down the line.

Yeah, VHDL was created in the 80's out of a need to document. The fact that it looks like Ada, which is a language mostly used for military applications (and I THINK some AI research, but don't quote me), is a hint. Like I said, every year they figure out how to make more and more of it synthesizeable, but it is difficult work.

Oh, I'm not saying that OO-HDL and such don't work, don't misunderstand. I'm just saying that I don't like the idea of making HDL too close to programming, as I believe it encourages bad design practices (or worse: sending a CS to do an EE's job). Intel is a special case, though, because the kind of work they do is pretty specialized, and has very different requirements than most FPGA or ASIC design projects. When it comes to HDL use, they're the edge-case, the most hard-core of the hard-core. Besides, the quality of engineer they hire is smart enough to not make the mistakes I'm worried about in these cases.

Hm, one of the smaller vendors I've used is Lattice Semiconductor, but they're not THAT small. Then there's Actel(well, Microsemi now), Silicon Blue, Abound Technology, and a few others. Granted, Altera and Xilinx are the undisputed kings (I'm an Altera man myself, I just like Quartus II better.), but there are quite a few smaller players with decent niches.

Programming talk!
Nothing of the sort. More like computer-aided digital hardware design. I could (if I were insane) implement the results of HDL code in discrete transistors on a circuit board (well, clock frequency may make this infeasible due to connections becoming electrically long and extending into the far-field and all that jazz). In fact, an old classmate who was my senior in undergrad did an interesting contest entry for digital design, then reimplemented it in VHDL.

The Masochist's Video Card
The Semi-Sane Way

Only thing that bugs me is that he uses std_logic_arith and std_logic_unsigned.all (which are big no-nos!), but this shows the idea pretty well.
Did we really just spend the last decade talking about Chex Quest? Yes. Yes we did.

I regret nothing!

Chex Quest Fan Forums

Re: FPGA Malarkey
« Reply #15 on: March 27, 2015, 09:10:17 PM »

Offline 75

  • [IFOC] Server Admin
  • Multiplayer Team Leader
  • Chex Master
  • *****
  • Thank You
  • -Given: 32
  • -Receive: 27
  • Posts: 4244
    • IFOCSERV
Re: FPGA Malarkey
« Reply #16 on: March 27, 2015, 10:31:36 PM »
I really enjoyed working with Q2 as well but I can't figure out how to get Modelsim to simulate my verilog waveforms, I think it might be VHDL only?

I use isim for simulation now, though I wish I could get modelsim working with verilog (even though I prefer isim's design flow and UI over modelsim's). I'd go back to Q2 if I could find a simulator that worked with verilog.

A while ago I was tempted to make my own overloaded std_logic_vector arithmetic library just for my own use, but it's probably better I didn't.

That VGA project is cool, I would love to know how to output HDMI video from my (Altera Cyclone V / Terasic board) FPGA, I started looking at it a few times but I haven't actually tried it, I'd imagine it would make debugging a lot easier? Heck, even if I just got atari 2600 level graphics working I'd consider it worth doing as a learning exercise.

I'm also very interested in producing sound from FPGAs, it would be cool if I could use it to generate some primitive waveforms and make a cheap synth!

At one point I was thinking of trying to make my own ethernet card PHY using FPGAs but I didn't pursue that.
« Last Edit: March 27, 2015, 10:36:56 PM by 75 »
"Give us those nice bright colors, give us the greens of summer, makes you think all the world's a sunny day."

You can find me on the CQFF discord: https://discord.gg/AgNhjem

Offline MajorSlime

  • Self-Proclaimed ACS Grandmaster
  • Multiplayer Team Leader
  • Chex Master
  • *****
  • Thank You
  • -Given: 18
  • -Receive: 29
  • Posts: 4308
  • If life gives you lemons, give its lemons back!
    • Chex Quest: Reflections
Re: FPGA Malarkey
« Reply #17 on: March 27, 2015, 10:42:51 PM »
http://digilentinc.com/Products/Detail.cfm?NavPath=2,1301,1319&Prod=NEXYS4DDR


That's the board I got. It comes with VGA and Audio out ports. As far as how to use them, I have no idea yet. I'll let you know when I figure it out :P. The final goal with the 8-bit processor my group is making is to produce Pong.
Shh!  I'm taking a break from reality.

John 3:16
For God so loved the world, that he gave his only son, that whoever believes in him shall not perish, but have eternal life!

Give God your life; You won't regret it!

Offline Loremaster

  • Administrator
  • Maximus
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 9
  • Posts: 1549
  • No, Jum. You are the dolls.
Re: FPGA Malarkey
« Reply #18 on: March 28, 2015, 04:30:09 AM »
Sometime around Version 10, Quartus II's simulation stuff was buggered pretty bad. It wasn't until like 13.0 that they got their act together and put it back like in version 9. You should be able to make it work with Verilog, but I'd probably have to be at the computer with you to work it out.

Outputting video is going to involve external circuitry, especially in the case of VGA, since VGA is an analog signal. Doing many colors isn't too bad, you just encode your RGB channels in a logic vector of however many bits each D/A channel can handle. I did the bouncing ball VGA project where I replaced the stupid square ball with an 8-bit color sprite (Reimu from Touhou 1) in a memory initialization file, read from that, drew the field, scanned it line by line, and spat 24-bit color values out to my D/A. Not too bad, but doing all the timing was interesting. Many clock dividers! Clocks are critical in VGA. I've never done HDMI, but I believe you can omit the D/A (I think it is digital?), and the timing might be easier to deal with. It might require a pretty fast hardware clock though.

Sound is easy! All about frequency and PWM! Unless you want to do a D/A, then you can either generate directly triangle or square forms, or use a table for doing sine waves. Really, simple sounds from an FPGA are pretty easy to do. Heck, it might be fun to try to clone the NES's sound chip. Might be a lot of work, but it would be pretty interesting. Of course, again you'll need external circuitry, like an Op-Amp or some other amplifier circuit. I did some simple square wave bleeping with an LM324 Audio Op-Amp back in undergrad. It was pretty neat.

http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=53&No=30&PartNo=1

This was the board I was using. I'm looking into buying a better one for my personal use, but they're expensive. Right now I have a Lattice Semiconductor MachXO breakout board, but it is pretty barebones and I'm not a fan of their software. At all. Still, it was free as I was the Lab TA for a class that used it, so I can't complain.
http://www.latticesemi.com/en/Products/DevelopmentBoardsAndKits/MachXOBreakoutBoard.aspx

I'd love to get either this
http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=139&No=502

Or this
http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=139&No=502

Or perhaps this
http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=167&No=921

But I can't justify it right now. Maybe later this year, perhaps in the summer when I'm free do go back to digital projects. I'm in an EMC class right now, and we're doing a competition project, so I've been dealing with stuff I don't normally do (seriously, I have most parts stocked in my home lab except.... inductors! Y'know, a critical component in RF and EMC design?) and neglecting my digital stuff.
Did we really just spend the last decade talking about Chex Quest? Yes. Yes we did.

I regret nothing!

 


Web Hosting by InMotion Hosting