FPGA programmers out there?

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

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

jemismyname
Atariator
Atariator
Posts: 22
Joined: Wed Feb 27, 2019 8:25 pm

FPGA programmers out there?

Postby jemismyname » Mon Mar 04, 2019 2:14 am

I wonder, since everybody in this group, pretty much, has a nice quality student-oriented FPGA development board, has anybody gotten into FPGA programming just from being a MISTer user?

I'm thinking of diving in... Maybe to make a weird audio synthesizer or something?

I would ultimately like to get good enough to program some MISTer cores, but i don't have any arcade hardware to play with... I want to make a Rygar core, for some reason...

does anyone out there like/remember Rygar?

User avatar
kitrinx
Atari freak
Atari freak
Posts: 73
Joined: Wed Sep 26, 2018 6:03 am

Re: FPGA programmers out there?

Postby kitrinx » Mon Mar 04, 2019 2:21 am

I am a software engineer, but I learned to write HDL just for MiSTer.

And I played Rygar for NES quite a bit, back in the day. Arcade was much better though.

alanswx
Atari freak
Atari freak
Posts: 66
Joined: Sat Nov 25, 2017 4:34 pm

Re: FPGA programmers out there?

Postby alanswx » Mon Mar 04, 2019 4:26 pm

I am also a software person who picked up Verilog for MiSTer. It has a very steep learning curve, and it is hard to debug. I started by reading this book:
https://robo-tronix.weebly.com/uploads/2/3/2/1/23219916/veriloghdlsamirpalnitkar.pdf and I installed iverilog on my mac, and just wrote a couple of hello world programs.

Also, you can take a look at centipede and food fight from my repo. They have been updated to use verilator and SDL2 so you can write a simulation, debug it, and view it on the pc. See:
https://github.com/alanswx/arcade-centipede/

A lot of people like VHDL instead of verilog, or system verilog, here is a book:
http://ebook.pldworld.com/_eBook/FPGA%EF%BC%8FHDL/-Eng-/Verilog%20HDL%20Synthesis.%20A%20Practical%20Primet%20(Bhasker).pdf

I don't believe we can simulate VHDL using verilator, I haven't dug through and found an open source tool chain that will allow us to do that yet.

I don't believe you need a board to build the Rygar, you should look through the schematics, and MAME and that should be enough to build it:
http://www.jammarcade.net/files/Schematics/Arcade/Rygar.pdf

flain
Atariator
Atariator
Posts: 18
Joined: Sat Nov 03, 2018 6:21 am

Re: FPGA programmers out there?

Postby flain » Mon Mar 04, 2019 10:00 pm

i did logic circuits as a course like 15 years ago before i started a career, with mister i brushed up on some of that again

some good videos for revision are the nandland ones on youtube

EisernSchild
Atarian
Atarian
Posts: 5
Joined: Sat Nov 25, 2017 10:00 pm

Re: FPGA programmers out there?

Postby EisernSchild » Sun Mar 17, 2019 7:54 am

I'm a long year gpu programmer (c++, hlsl/glsl) and came to HDL via the MiSTer project. First i started on the Taito "Qix" hardware but wasn't able (until now) to synchronize the two main CPUs. Then i continued with "Tutankham" - which has very, very simple hardware - and had success, the game should be finished soon.

I do not have any arcade hardware either, i am using the MAME source code and the MAME debugger to find out what the game hardware actually does. And i do output in-game cpu values (like program counter and registers) on (MiSTer) screen in hex format to compare this to the simultanous running MAME debugger (on my PC) to find out what is going wrong in case.

About "RYGAR" : This one has the same hardware as "Silkworm" and "Gemini Wing". It has two main CPUs, from "Qix" i know that it is hard to syncronize them. And there is not much documentation out there about the actual hardware, so i would recommend to start with a much simpler game.

Get into the code from the (most simple) MiSTer arcade games and compare their doing with the MAME debugger for startup.

hyiger
Atarian
Atarian
Posts: 4
Joined: Sun Mar 17, 2019 5:18 pm

Re: FPGA programmers out there?

Postby hyiger » Sun Mar 17, 2019 7:22 pm

Working with a FPGA is not the same as writing software for a CPU. First you are not "programming" in the traditional sense, you are using a HDL (hardware description language) such as VHDL or Verilog to design and wire up a circuit. With modern FPGA's from Xilinx or Intel (formerly Altera) you can develop parts of the core in C/C++ or Python but then this ultimately gets synthesized into a hardware circuit. Also, the hardware circuits that are generated by the synthesizer (analogous to a compiler for CPU programming languages) are inherently parallel and very hard to debug without creating circuit simulations or using a logic analyzer. Therefore, I would say the learning curve is pretty steep unless you already have a background in digital design. That being said, with modern tooling it's a lot easier to learn today than it was say 10-15 years ago.

Personally I use VHDL since it is more strongly typed than Verilog (for example Pascal/Ada versus C/C++) and I find I understand it better since Verilog can be quite terse. However, it helps to know both. For VHDL I would recommend starting with: FreeRange VHDL then even though it's slightly dated I would recommend: FPGA Prototyping by VHDL examples He also has the same book for Verilog.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4039
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: FPGA programmers out there?

Postby Sorgelig » Sun Mar 17, 2019 8:14 pm

Both languages have their strong and weak points.
I like Verilog because all types are interchangeable. In VHDL for example boolean and logic values are completely different types which requires long and cluttered expressions. But sometimes VHDL is better in some circumstances.

hyiger
Atarian
Atarian
Posts: 4
Joined: Sun Mar 17, 2019 5:18 pm

Re: FPGA programmers out there?

Postby hyiger » Sun Mar 17, 2019 9:04 pm

It really comes down to personal preference, in the end both languages accomplish the same thing. Verilog seems to be more common in the US and VHDL elsewhere. When I first got involved in FPGAs I started off using Verilog but somehow kept gravitating toward VHDL since there seemed to be a lot more hidden "magic" with Verilog and I could visualize the circuit better reading VHDL. Now I use VHDL almost exclusively. I think the reason is that on the CPU side I used to do a lot of development in C++ but now use Java and C# and prefer the extra levels of type checking and verboseness of the later. Personally I think VHDL hurts the brain a lot less... But again it comes down to: 6502 or Z80, Emacs or Vi, Coke or Pepsi, etc.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4039
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: FPGA programmers out there?

Postby Sorgelig » Mon Mar 18, 2019 4:57 am

hyiger wrote:6502 or Z80

Although i've used some i8080 in my childhood, the major time and my initial grow as a software developer was based on PDP11 assembler. And at that time assembler was the only language available for home computers (i don't count the basic and other mostly useless languages). And with PDP11 you could write even in machine codes without any tables around you as its code structure is like RISC with hard defined bit structure.
So for me both 6502 and Z80 were looked as utter rubbish :mrgreen: Sorry 6502/Z80 fans :)
I couldn't understand how it's possible to write any assembler program with such strange limited assembler without choice of addressing methods. Z80 even uses backward order of operands (what a perversion!)
Sure, a lot of time passed since that time. Today it's not a problem for me to write for any CPU. Especially you don't need to remember the machine codes today, and can use PC based compilers.

jemismyname
Atariator
Atariator
Posts: 22
Joined: Wed Feb 27, 2019 8:25 pm

Re: FPGA programmers out there?

Postby jemismyname » Mon Mar 18, 2019 7:19 am

Thanks for all of the good answers. I know a good bit of digital and analog hardware design stuff.. and i know at least some theory of cpu design and implementation.

I even took a VHDL class 15 years ago. I passed the class, but we mostly just did dumb stuff with switches and blinky lights and 7 segment displays... it's a whole different world now.

From what people have told me recenlty, i think i should try verilog instead... not like i remember VHDL anyway.

I'll check out some of the simple arcade cores for examples, but i think i'll try Rygar anyway. I've always had an interest in last-century multi-CPU gaming hardware. Even if it turns out to be way over my head, I'll just make something glitchcore AF, and pretend that's what i meant to do.

After that: Sega Saturn. lol

jemismyname
Atariator
Atariator
Posts: 22
Joined: Wed Feb 27, 2019 8:25 pm

Re: FPGA programmers out there?

Postby jemismyname » Mon Mar 18, 2019 7:23 am

hyiger wrote:Emacs or Vi


i prefer nano, but i'm a weenie

jemismyname
Atariator
Atariator
Posts: 22
Joined: Wed Feb 27, 2019 8:25 pm

Re: FPGA programmers out there?

Postby jemismyname » Mon Mar 18, 2019 7:57 am

alanswx wrote:I don't believe you need a board to build the Rygar, you should look through the schematics, and MAME and that should be enough to build it:
http://www.jammarcade.net/files/Schematics/Arcade/Rygar.pdf


this link is dead sad

alanswx
Atari freak
Atari freak
Posts: 66
Joined: Sat Nov 25, 2017 4:34 pm

Re: FPGA programmers out there?

Postby alanswx » Mon Mar 18, 2019 11:04 pm

jemismyname wrote:
alanswx wrote:I don't believe you need a board to build the Rygar, you should look through the schematics, and MAME and that should be enough to build it:
http://www.jammarcade.net/files/Schematics/Arcade/Rygar.pdf


this link is dead sad
You do not have the required permissions to view the files attached to this post.

hyiger
Atarian
Atarian
Posts: 4
Joined: Sun Mar 17, 2019 5:18 pm

Re: FPGA programmers out there?

Postby hyiger » Sat Mar 23, 2019 5:11 pm

Sorgelig wrote:I couldn't understand how it's possible to write any assembler program with such strange limited assembler without choice of addressing methods. Z80 even uses backward order of operands (what a perversion!)
Sure, a lot of time passed since that time. Today it's not a problem for me to write for any CPU. Especially you don't need to remember the machine codes today, and can use PC based compilers.


Well the Z80 is/was binary compatible with the 8080 so inherited a lot of weirdness from Intel. I had a TRS-80 Model I with 4K of RAM which wasn't even enough RAM to fit an assembler. I quickly outgrew Tiny Basic and was punching in Z80 machine code with hexadecimal keypad I had wired into my TRS-80 keyboard. 40 years later I still remember a lot of the op codes. I've recently built some Z80 based SBC's and have gotten back into Z80 ASM. Definitely a lot harder than JAVA or C# but a lot more fun.

With the 6502 vs Z80 it's a matter of modified Harvard architecture vs von Neumann. Also mpu's back then generally had to be CISC (with the exception of the PDP-8 which like it's version number only had 8 op codes...)


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 1 guest