FPGA programmers out there?

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Sorgelig, Moderator Team

MartinW
Atari User
Atari User
Posts: 34
Joined: Thu May 09, 2019 9:28 pm

Re: FPGA programmers out there?

Post by MartinW »

jemismyname wrote:
MartinW wrote:I used to fix arcade PCBs part time... I basically got board of it though.
heh heh
LOL!! Oops, that wasn't intentional :D

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Post by nullobject »

I finally made some progress:

I got my development environment all set up nicely (I'm running Quartice 18.1 inside Virtual Box on my Macbook Air). I can build my core quickly from the command line, using a simple makefile. This makes for fairly fast iteration, even though it takes a couple of minutes to compile my core.

I got the Z80 CPU running and the main RAM and ROM chips all connected with proper address decoding. I figured out how to load the program ROMs onto the FPGA using MIF files. This means that I don't have to worry about the MiSTer side of things just yet, as the ROM data is all hard-coded.

So far it has been quite challeng for a noobie like me. I ended up adding a bunch of extra debugging LEDs to show me the state of the CPU address and data buses, as well as the M1, MREQ, RD, WR, RFSH, and HALT signals. Once I could actually see what was going on inside the CPU, things started to make a lot more sense.

You can see my core running Rygar at a very slow clock speed. Next step is to speed things up and try to add some video output 8O

Image

User avatar
DrOG
Atari Super Hero
Atari Super Hero
Posts: 724
Joined: Sun Jul 31, 2016 8:23 pm
Location: Gyula, Hungary

Re: FPGA programmers out there?

Post by DrOG »

Looks brutal :D !

slingshot
Atari God
Atari God
Posts: 1664
Joined: Mon Aug 06, 2018 3:05 pm

Re: FPGA programmers out there?

Post by slingshot »

nullobject wrote: So far it has been quite challeng for a noobie like me. I ended up adding a bunch of extra debugging LEDs to show me the state of the CPU address and data buses, as well as the M1, MREQ, RD, WR, RFSH, and HALT signals. Once I could actually see what was going on inside the CPU, things started to make a lot more sense.
You can use SignalTap II to introspect what's happening inside the FPGA. I found it an essential tool for debugging. However it's not that flashy like the LEDs :)

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Post by nullobject »

slingshot wrote:You can use SignalTap II to introspect what's happening inside the FPGA. I found it an essential tool for debugging. However it's not that flashy like the LEDs :)
Fancy. I'll have to check that out, thanks for the tip :mrgreen:

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Post by nullobject »

OMG pixels!

Now to start work on the Rygar graphics pipeline, how hard could it be? :mrgreen:

Image

MartinW
Atari User
Atari User
Posts: 34
Joined: Thu May 09, 2019 9:28 pm

Re: FPGA programmers out there?

Post by MartinW »

nullobject wrote:How hard could it be? :mrgreen:
Very interested to hear the answer to that since if the screenshot is anything to go by then it would seem you have the same FPGA eBook as me :D

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Post by nullobject »

MartinW wrote:Very interested to hear the answer to that since if the screenshot is anything to go by then it would seem you have the same FPGA eBook as me :D
If you mean 'Designing Video Game Hardware in Verilog' then yes, I have the printed version :D

The book is great, I've been learning a lot from it. Sometimes it doesn't translate perfectly to a real FPGA, because all of their examples are written to run in the 8bitworkshop IDE, but it has definitely been very helpful on my journey.

From what I've learned so far, the graphics pipeline is the most complex part of porting a game to an FPGA. It's where most of the timing-critical stuff happens, and if you don't have it correct then you just end up with a bunch of garbage on the display. I'm currently trying to muddle my way through it 8O

Last night I got the character tile decoding circuit working, although I still have some timing issues:

Image

MartinW
Atari User
Atari User
Posts: 34
Joined: Thu May 09, 2019 9:28 pm

Re: FPGA programmers out there?

Post by MartinW »

Yep, that’s the one. I had the same thoughts on that IDE but was also hoping that it wouldn’t be too hard to apply it to real FPGA hardware.

I need to get Quartus setup on my MBpro in VMWare so I can start to play with the DE-10. So far I’ve used Xilinx / Spartan stuff from a Hyper-V guest on my gaming pc :)

alanswx
Captain Atari
Captain Atari
Posts: 224
Joined: Sat Nov 25, 2017 4:34 pm

Re: FPGA programmers out there?

Post by alanswx »

MartinW wrote:Yep, that’s the one. I had the same thoughts on that IDE but was also hoping that it wouldn’t be too hard to apply it to real FPGA hardware.

I need to get Quartus setup on my MBpro in VMWare so I can start to play with the DE-10. So far I’ve used Xilinx / Spartan stuff from a Hyper-V guest on my gaming pc :)
I got it running using docker:
https://hub.docker.com/r/chriz2600/quartus-lite/
Switch the docker image version to 17.1.1 or something g like that - see the tags.

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Post by nullobject »

alanswx wrote: I got it running using docker:
https://hub.docker.com/r/chriz2600/quartus-lite/
Switch the docker image version to 17.1.1 or something g like that - see the tags.
Wow, that's sweet. Can you run the device programmer with it too?

alanswx
Captain Atari
Captain Atari
Posts: 224
Joined: Sat Nov 25, 2017 4:34 pm

Re: FPGA programmers out there?

Post by alanswx »

nullobject wrote:
alanswx wrote: I got it running using docker:
https://hub.docker.com/r/chriz2600/quartus-lite/
Switch the docker image version to 17.1.1 or something g like that - see the tags.
Wow, that's sweet. Can you run the device programmer with it too?
I think you can. There are some docs somewhere.

I launched and opened x windows and did an xhost + then I launch the GUI (pass in the display parameters). And I usually just create rbf files and copy them to mister.

I need to improve my workflow so I can use signaltap - but I am not there yet.

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Post by nullobject »

Another status update:


User avatar
DrOG
Atari Super Hero
Atari Super Hero
Posts: 724
Joined: Sun Jul 31, 2016 8:23 pm
Location: Gyula, Hungary

Re: FPGA programmers out there?

Post by DrOG »

Nice progress! :cheers:

User avatar
bazza12
Atariator
Atariator
Posts: 29
Joined: Sun Feb 17, 2019 5:45 pm
Location: Yorkshire, England.
Contact:

Re: FPGA programmers out there?

Post by bazza12 »

great work :)

User avatar
Newsdee
Atari God
Atari God
Posts: 1554
Joined: Fri Sep 19, 2014 8:40 am

Re: FPGA programmers out there?

Post by Newsdee »

Thanks for sharing, its inspiring to see such great progress!

SegaMan
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 102
Joined: Sat Oct 27, 2018 12:59 pm

Re: FPGA programmers out there?

Post by SegaMan »

Rygar is one of my fav game.

Nice to see it comming to MiSTer :cheers:

Great work.

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Post by nullobject »

Thanks. I still have audio to do, but it's getting close :megaphone:

MysteryM
Atariator
Atariator
Posts: 26
Joined: Fri Nov 23, 2018 9:45 am

Re: FPGA programmers out there?

Post by MysteryM »

Amazing work, I'm a programmer by trade but never looked at emulation and hardware recreation in fpga so I'm a little jealous of your ability. Fair play mate and thanks for your hard work :cheers:

User avatar
Newsdee
Atari God
Atari God
Posts: 1554
Joined: Fri Sep 19, 2014 8:40 am

Re: FPGA programmers out there?

Post by Newsdee »

nullobject wrote: If you mean 'Designing Video Game Hardware in Verilog' then yes, I have the printed version :D
By any chance, would you have some of the basic examples running with the DE10 and Quartus?

I just got this book and I suppose it may be easier to learn if I could use the DE10 for debugging.
Or do you think their toolkit is good enough as a starting point?

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Post by nullobject »

Newsdee wrote:By any chance, would you have some of the basic examples running with the DE10 and Quartus?

I just got this book and I suppose it may be easier to learn if I could use the DE10 for debugging.
Or do you think their toolkit is good enough as a starting point?
I think the book is great as far as some of the basic concepts go (CRT timing, sprites, tilemaps, etc.). The 8bitworkshop IDE is nice if you want to quickly try out some of the Verilog examples from the book.

But you will learn way more IMHO if you actually try to implement something on the DE10 nano for real.

I made a few small projects to try to focus on some of the concepts as I was building the Rygar core. They are all written in VHDL, because I don't know how to code in Verilog:

Simple LED counter: https://github.com/nullobject/de10-nano-counter
Video output: https://github.com/nullobject/de10-nano-video
Sprite rendering: https://github.com/nullobject/de10-nano-sprite
Z80 CPU: https://github.com/nullobject/de10-nano-z80

This is basically how I developed the Rygar core. I would just focus on something in a very small stand-alone project, and once I got it working I would integrate it back into the actual Rygar core.

This saves you a lot of time because the bigger your project gets, the longer it takes to compile. When you're trying to learn something it helps to be able to iterate (fix, compile, run) very quickly.

I hope this helps :)

jemismyname
Atari maniac
Atari maniac
Posts: 78
Joined: Wed Feb 27, 2019 8:25 pm

Re: FPGA programmers out there?

Post by jemismyname »

OOOooo this is so cool to see your progress with Rygar! I feel just like Tom Sawyer, right now.

::whistles::

I really gotta learn this stuff properly. This motivates me!
It is said that recreating arcade games in verilog is even more fun than whitewashing a fence!

Truxton, tho...

User avatar
c0nn0r
Atarian
Atarian
Posts: 2
Joined: Mon Mar 18, 2019 7:26 pm

Re: FPGA programmers out there?

Post by c0nn0r »

Thank you nullobject for this project and the documentation. As someone who is interested in tinkering with FPGA development it is quite difficult to find information or answers.

Perhaps you (or someone) can give me some pointers.

Background:
In real life I have had some success modding existing simple electronics; think circuit-bending and the like. In many of these cases I would simply jumper a line here and there, or add a simple component like a switch or a rotary potentiometer.

As a VHDL novice I am very interested in the ability to use a visual schematic view of a project, and use a tool to virtually add and connect components to an existing project.

I am using Quartus Prime and have been able to take an existing core and successfully generate a Netlist with the RTL viewer. This gives me a visual schematic view. The problem here is that I have not figured out how to make this schematic view "editable".

I have also be able to add a Block Diagram/Schematic File to an existing project. This is a visual editor of the sort I have been looking for, but the problem here is that the file is blank.

Question:
How can I load an existing project into a Quartus Prime Block Diagram/Schematic File? Is this the correct way to do this?

Cheers - any help will be appreciated.

:cheers:

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: FPGA programmers out there?

Post by Sorgelig »

c0nn0r wrote:How can I load an existing project into a Quartus Prime Block Diagram/Schematic File? Is this the correct way to do this?
The module you want to see in schematic drawing should be designed in schematic originally. You can't open Verilog or VHDL as schematic. Probably some convertors exist, but schematic way is a worst way to design the cores. FPGA doesn't work well in traditional discrete logic asynchronous mode where any signal can be a clock for random register. So FPGA's logic has to work in synchronous mode which implies a common clock and many clock enablers. In traditional schematic it will look more complex, convoluted and non-demonstrative.
So almost everything is designed in programmatic HDL mode and should be read that way. Like traditional C listing.

User avatar
nullobject
Retro freak
Retro freak
Posts: 16
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Thoughts on the MiSTer updater script

Post by nullobject »

I just wanted to throw out a couple of ideas for improving the MiSTer updater script.

Is there any reason we don't leverage the GitHub releases feature?

I come from the software engineering world, and keeping binary files in a git repo isn't considered best practice because git can't do any optimisation on the changes to binary files. They are stored verbatim in the repo (i.e. every time you update a binary file, git will store another copy of it). Eventually your repo grows in size (aka. bloat).

If we use GitHub releases, then we store the compiled cores outside the repo. You can also do other neat things with the GitHub API, like only request the latest release, etc. This would make it quite trivial to add a feature to the MiSTer updater script to download the latest version of a core from the GitHub releases.

Thoughts? :mrgreen:

Locked

Return to “MiSTer”