FPGA programmers out there?

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

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

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

Re: FPGA programmers out there?

Postby MartinW » Fri Jun 21, 2019 11:22 pm

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: 14
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Postby nullobject » Thu Jun 27, 2019 12:10 am

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: 633
Joined: Sun Jul 31, 2016 8:23 pm
Location: Gyula, Hungary

Re: FPGA programmers out there?

Postby DrOG » Thu Jun 27, 2019 3:59 am

Looks brutal :D !

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

Re: FPGA programmers out there?

Postby slingshot » Thu Jun 27, 2019 8:18 am

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: 14
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Postby nullobject » Thu Jun 27, 2019 10:42 am

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: 14
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Postby nullobject » Tue Jul 02, 2019 3:42 am

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?

Postby MartinW » Mon Jul 08, 2019 12:32 pm

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: 14
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Postby nullobject » Mon Jul 08, 2019 11:45 pm

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?

Postby MartinW » Tue Jul 09, 2019 12:47 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 129
Joined: Sat Nov 25, 2017 4:34 pm

Re: FPGA programmers out there?

Postby alanswx » Wed Jul 10, 2019 11:12 am

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: 14
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Postby nullobject » Wed Jul 10, 2019 12:03 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 129
Joined: Sat Nov 25, 2017 4:34 pm

Re: FPGA programmers out there?

Postby alanswx » Wed Jul 10, 2019 12:41 pm

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: 14
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Postby nullobject » Mon Aug 12, 2019 1:22 am

Another status update:


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

Re: FPGA programmers out there?

Postby DrOG » Mon Aug 12, 2019 4:29 am

Nice progress! :cheers:

User avatar
bazza12
Retro freak
Retro freak
Posts: 15
Joined: Sun Feb 17, 2019 5:45 pm
Location: Yorkshire, England.
Contact:

Re: FPGA programmers out there?

Postby bazza12 » Mon Aug 12, 2019 6:38 am

great work :)

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

Re: FPGA programmers out there?

Postby Newsdee » Mon Aug 12, 2019 5:44 pm

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

SegaMan
Atari freak
Atari freak
Posts: 72
Joined: Sat Oct 27, 2018 12:59 pm

Re: FPGA programmers out there?

Postby SegaMan » Tue Aug 13, 2019 12:26 pm

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: 14
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Postby nullobject » Tue Aug 13, 2019 11:27 pm

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

MysteryM
Atarian
Atarian
Posts: 6
Joined: Fri Nov 23, 2018 9:45 am

Re: FPGA programmers out there?

Postby MysteryM » Wed Aug 14, 2019 8:03 am

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: 1433
Joined: Fri Sep 19, 2014 8:40 am

Re: FPGA programmers out there?

Postby Newsdee » Mon Aug 19, 2019 4:54 am

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: 14
Joined: Mon Feb 27, 2017 3:58 am
Contact:

Re: FPGA programmers out there?

Postby nullobject » Thu Aug 22, 2019 12:09 am

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 freak
Atari freak
Posts: 68
Joined: Wed Feb 27, 2019 8:25 pm

Re: FPGA programmers out there?

Postby jemismyname » Mon Aug 26, 2019 4:49 am

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...


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 9 guests