FPGA project

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
teaguecl
Posts: 211
Joined: Thu Oct 21, 2004 4:02 pm
Location: San Diego

FPGA project

Post by teaguecl »

I have a little free time again (this never happens!) and have been hoping to dust off my FPGA/HDL skills. I've been wanting to do a NES related FPGA project forever, and even started one a few years back, but like most projects it never really got off the ground.
I'm looking to see if there is any interest, since I'm likely going to need some help. I'm thinking about doing a CPU in HDL, and later on adding a PPU and APU. The whole thing must be open source, I don't want another implementation around that nobody can use.
I was also thinking that getting a collaboration on FPGA stuff is difficult because nobody owns exactly the same development system - and it's very expensive to buy new. To alleviate that I was thinking of not having a dev board at all, but to use simulation only. That way anyone with a PC can contribute - and maybe some nice developer will throw it on a dev board for us someday.
So I was thinking about using one of these tools: GHDL, Verilator, or Icarus.
Would anyone be interested in contributing to this project? Preferences on the tools above? The initial goal would be a CPU with the ability to pass Blargg's cpu tests. I'm not really crazy about going it alone, since I tend to work in spurts - and that leads to long periods of no progress.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Are there any 6502 processors on OpenCores.org?
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

I believe there is a 6502 core there, but it's in VHDL. I'm more interested in using Verilog.

Sounds like it would be interesting, I've been using Verilog a little (with a CPLD) and it would be interesting to be able to get a little more practice. But I've got more projects than I do time, so I doubt I could be of much help.

Simulation sounds kinda boring though, to me. :|
3gengames
Formerly 65024U
Posts: 2284
Joined: Sat Mar 27, 2010 12:57 pm

Post by 3gengames »

Sounds awesome! It'd be nice to see a PPU core done :D Especially a RGB version so we don't have to kill playchoices for them! :shock: :oops: :roll:



Hope this gets going and is fun, this sounds super epic. :)
User avatar
cpow
NESICIDE developer
Posts: 1097
Joined: Mon Oct 13, 2008 7:55 pm
Location: Minneapolis, MN
Contact:

Post by cpow »

Memblers wrote:I believe there is a 6502 core there, but it's in VHDL. I'm more interested in using Verilog.

Sounds like it would be interesting, I've been using Verilog a little (with a CPLD) and it would be interesting to be able to get a little more practice. But I've got more projects than I do time, so I doubt I could be of much help.

Simulation sounds kinda boring though, to me. :|
I'm also into Verilog. I'd be willing to help. But I also have more projects than time. :roll:
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

I think it's even harder to collaborate with hardware than it is with software. There are so few limitations that preferences come out immediately. Not only does everyone have stylistic differences but will implement at different levels of abstraction, will write more or less synthesizable code and have a different thoughts on accuracy. With hardware often these differences aren't compatible. Really it will come down to whoever starts the HDL module or a lot of foundation logic will be overwritten by each contributor to suit their needs.
User avatar
jwdonal
Posts: 719
Joined: Sat Jun 27, 2009 11:05 pm
Location: New Mexico, USA
Contact:

Re: FPGA project

Post by jwdonal »

teaguecl wrote:I have a little free time again (this never happens!) and have been hoping to dust off my FPGA/HDL skills. I've been wanting to do a NES related FPGA project forever, and even started one a few years back, but like most projects it never really got off the ground.
I'm looking to see if there is any interest, since I'm likely going to need some help. I'm thinking about doing a CPU in HDL, and later on adding a PPU and APU.
I have all this in Verilog right now including an RGB-output PPU (APU still needs lots of work though only DMC is fully functional). But it is still closed source at the moment. I've got some co-workers and business associates that really want me to open source everything but I have the standard concerns about people plagiarizing my code or selling the code/netlists and making some type of profit. :-/ And of course, with all the NES-FPGA college projects that students are always emailing me about, there would certainly be some unethical "code-copying" going on. Lol. I mean, I realize there are benefits to open-sourcing as well....I just need a bit (ton?) of convincing before I'm willing to open source. I've thought about selling the source as well but then there are a ton of legal issues with that and the high probability that Nintendo would sue me. :-P
The whole thing must be open source, I don't want another implementation around that nobody can use.
Haha, I guess I would be one of those jerks. Lol. :-P
I was also thinking that getting a collaboration on FPGA stuff is difficult because nobody owns exactly the same development system - and it's very expensive to buy new. To alleviate that I was thinking of not having a dev board at all, but to use simulation only.
If you're just simulating the CPU by itself with some custom code and such then this is fine but as soon as you want to start simulating full games and such with the PPU/APU etc you run into major problems with simulation time. You would literally have to run a simulation for months to get enough resulting data. I have already run into this. I am already at the point where I have to use an embedded logic analyzer within the FPGA itself (e.g. Xilinx chipscope) in order to debug anything at all.
3gengames
Formerly 65024U
Posts: 2284
Joined: Sat Mar 27, 2010 12:57 pm

Post by 3gengames »

You have a RGB-PPU? I would certainly but the chip off you if you released it. Probably more though! Killing PC-10's for them to me is just too much for me. I couldn't do it. :/
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

I'm in the same boat as jwdonal, there are just too many concerns since it's a highly valuable project.
65024U wrote:You have a RGB-PPU? I would certainly but the chip off you if you released it. Probably more though! Killing PC-10's for them to me is just too much for me. I couldn't do it. :/
A FPGA can't just be popped into place, it will not only take exceptional design accuracy in order to interface with real hardware, but it will take level conversion and significant support circuitry... There's no way people will use them over PC10 PPUs.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

kyuusaku wrote:
65024U wrote:You have a RGB-PPU? I would certainly but the chip off you if you released it. Probably more though! Killing PC-10's for them to me is just too much for me. I couldn't do it. :/
A FPGA can't just be popped into place, it will not only take exceptional design accuracy in order to interface with real hardware, but it will take level conversion and significant support circuitry... There's no way people will use them over PC10 PPUs.
What would be cool is if one made a board with the JAMMA interface so the FPGA could replace the whole Playchoice-10, but in a standard arcade cabinet. :)
3gengames
Formerly 65024U
Posts: 2284
Joined: Sat Mar 27, 2010 12:57 pm

Post by 3gengames »

I can't find it, but somebody already took the Williams arcade hardware for Defender or Robotron and put it on 3 chips. (Probably FPGA, but I don't recall. This was a couple years ago.) To emulate 6809E,RGB out to well gardner monitor, sound, input PIA, ROM board all in 3 is insane. I wish I could find it. :/ But hey atleast it is possible. And even the powerpak uses it in it's mapper circuitry. Maybe one day bunny will mess with this. I think adding this to the product line of RetroUSB store would be a HUGE hit with NES gamers! :D I can dream though. Seems like I do a lot of that though.
User avatar
teaguecl
Posts: 211
Joined: Thu Oct 21, 2004 4:02 pm
Location: San Diego

Re: FPGA project

Post by teaguecl »

jwdonal wrote:I have all this in Verilog right now including an RGB-output PPU (APU still needs lots of work though only DMC is fully functional). But it is still closed source at the moment. I've got some co-workers and business associates that really want me to open source everything but I have the standard concerns about people plagiarizing my code or selling the code/netlists and making some type of profit. :-/ And of course, with all the NES-FPGA college projects that students are always emailing me about, there would certainly be some unethical "code-copying" going on. Lol. I mean, I realize there are benefits to open-sourcing as well....I just need a bit (ton?) of convincing before I'm willing to open source. I've thought about selling the source as well but then there are a ton of legal issues with that and the high probability that Nintendo would sue me. :-P
Yes, your project is one of my inspirations - you should write more on your blog :)
The whole thing must be open source, I don't want another implementation around that nobody can use.
jwdonal wrote: Haha, I guess I would be one of those jerks. Lol. :-P
No, I certainly wouldn't call you a jerk. Your work is yours, you have every right to do whatever you feel is best with it.
jwdonal wrote:If you're just simulating the CPU by itself with some custom code and such then this is fine but as soon as you want to start simulating full games and such with the PPU/APU etc you run into major problems with simulation time. You would literally have to run a simulation for months to get enough resulting data. I have already run into this. I am already at the point where I have to use an embedded logic analyzer within the FPGA itself (e.g. Xilinx chipscope) in order to debug anything at all.
This is very helpful information, maybe this project isn't feasible the way I imagined it. Sure we can implement (yet another) 6502 using simulation, but if the other parts can't be done reasonably, then the whole thing becomes somewhat pointless.
Is there a cheap commodity, de-facto standard board we might be able to target? I'm thinking something equivalent to what arduino has become for microprocessors in the hobby community. The issue, and the reason I wanted to go with simulation, is that anything much more expensive than $100 and you can't get any momentum. Not many developers, and almost no users.
User avatar
jwdonal
Posts: 719
Joined: Sat Jun 27, 2009 11:05 pm
Location: New Mexico, USA
Contact:

Re: FPGA project

Post by jwdonal »

teaguecl wrote:...you should write more on your blog :)
Haha, I know! I've been a very bad boy lately. But don't worry I'm still very actively working on my NES. Right now I've been working on a Qt-based GUI interface over UART and Ethernet to the FPGA which allows you to load/verify ROMs and enter Game Genie codes, and lots of other cool stuff like CPU execution logging. I just haven't gotten the GUI to the point where I want to post screenshots yet. But I'm real close!! I will make a (huge) post very soon. :-P I've also been distracted with playing (and beating!) the PS3 game Demon's Souls - jeez, that game is freakin hard!!! It's like real old-school game hard! But I beat it! So there! Haha.
No, I certainly wouldn't call you a jerk. Your work is yours, you have every right to do whatever you feel is best with it.
No problem, I know you weren't calling anyone a jerk - I was calling myself a jerk. Lol. Really I guess I'm a hypocrite since I learn so much from the open source community myself. So philosophically (ethically?) the question becomes why am I not contributing more back?

Interestingly enough, I just had a long in-person chat tonight with one of my colleagues (who just happens to be at a conference that I'm attending this week) from the hugely popular verification company Doulos and he has some really convincing arguments on why I should just open source the whole thing. Haha, who knows, if he keeps chipping away at me you guys might get lucky. ;) He wants to co-author (i.e. he would do the formal verification bit and I would do the design bit) some design/verification papers with me and present them at conferences such as DVCon, SNUG, DAC, etc. So it wouldn't be until I got some prior publications and authorship credit that I would release the source - this is what makes open-sourcing a more "amicable" idea to me as there would at least be some "prior art" to show that I was the original author/creator of the code.
Is there a cheap commodity, de-facto standard board we might be able to target?
That question gets complicated because (at least with Xilinx) you run into the problem of "Okay, I have a cheap Virtex/Spartan board, now I just need to spend $2500 on the Xilinx development IDE to be able to synthesize/implement my design and target it to the FPGA." And then the $2500 doesn't even get you the add-ons like the chipscope in-circuit debugger tool and such. Lol, the "Nickel and Dime" motto is what these companies live off of.
The issue, and the reason I wanted to go with simulation, is that anything much more expensive than $100 and you can't get any momentum.
The problem your going to have with free/cheap simulators is that they are going to be slooooooooooow. If you want a fast simulator (which believe me you do) then you need something higher-end. The Synopsys VCS simulator is (I believe and from what I hear from other colleagues) the fastest simulator currently available on the market......but a single user license also costs tens of thousands of dollars. Haha. But that's not unusual. For example, Mentor QuestaSim, Cadence, Active-HDL simulators are all pretty much priced the same. Yes, it sux.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: FPGA project

Post by tepples »

jwdonal wrote:I've got some co-workers and business associates that really want me to open source everything but I have the standard concerns about people plagiarizing my code or selling the code/netlists and making some type of profit. :-/
Under most copyright licenses used for free software, "selling" is considered desirable, and "plagiarism" in the sense of failure to credit the author is an infringement. As for not getting what you believe to be your cut of the price of a properly credited copy, think of it this way: If someone starts selling computers based on a netlist that you created, and you're in the credits, you have something to put on your CV and show to future employers.
I've thought about selling the source as well but then there are a ton of legal issues with that and the high probability that Nintendo would sue me.
The patents on the NES hardware expired roughly five years ago, and virtually all mapper patents have expired as well. If you publish the design of a computing device compatible with NES software, Nintendo would have no case, and you could probably resolve the issue pro se. But if you do plan to implement anything and sell it, I would recommend a consultation with a lawyer.
User avatar
kevtris
Posts: 504
Joined: Sat Oct 29, 2005 2:09 am
Location: Indianapolis
Contact:

Re: FPGA project

Post by kevtris »

jwdonal wrote:
No, I certainly wouldn't call you a jerk. Your work is yours, you have every right to do whatever you feel is best with it.
No problem, I know you weren't calling anyone a jerk - I was calling myself a jerk. Lol. Really I guess I'm a hypocrite since I learn so much from the open source community myself. So philosophically (ethically?) the question becomes why am I not contributing more back?
Yes, this is the reason I haven't open sourced much of anything- I don't want someone taking my code and building some products around it, then me not getting a cut of that. There's no way to defend against this either. Sure you can sue 'em but a nobody with no money vs. some company doesn't work in the US. Whoever has the most money almost always wins (let alone can afford to sue and win).

Having said that, I don't know honestly how much worth such projects have, so maybe I'm being slightly paranoid.

Is there a cheap commodity, de-facto standard board we might be able to target?
That question gets complicated because (at least with Xilinx) you run into the problem of "Okay, I have a cheap Virtex/Spartan board, now I just need to spend $2500 on the Xilinx development IDE to be able to synthesize/implement my design and target it to the FPGA." And then the $2500 doesn't even get you the add-ons like the chipscope in-circuit debugger tool and such. Lol, the "Nickel and Dime" motto is what these companies live off of.
This is why you should use the Altera parts. Quartus (the dev environment) lets you target pretty large FPGAs and do in circuit signal tracing in the free version. I've been using it all along to develop my FPGA NES. There's plenty of power there to use for free. Not to mention the Altera software is worlds better than ISE webpack, IMO. Easier to use, seems more stable. ISE webpack is the sole reason I do not use xilinx parts in my projects, incidentally.

The issue, and the reason I wanted to go with simulation, is that anything much more expensive than $100 and you can't get any momentum.
The problem your going to have with free/cheap simulators is that they are going to be slooooooooooow. If you want a fast simulator (which believe me you do) then you need something higher-end. The Synopsys VCS simulator is (I believe and from what I hear from other colleagues) the fastest simulator currently available on the market......but a single user license also costs tens of thousands of dollars. Haha. But that's not unusual. For example, Mentor QuestaSim, Cadence, Active-HDL simulators are all pretty much priced the same. Yes, it sux.

I never understood the usefulness of simulator over a real FPGA to be honest. Once the design gets big enough, simulation gets useless. Signaltap (the on-chip logic analyzer) is insanely nice and easy to use for debugging any problems that come up. Now, I could see simulation being useful once the design got massive, however... like for chip tapeout verification and what-not, but for what amounts to hobby level projects, the simulator hasn't been too useful to me.

I will admit to designing my original 6502 core using the simulator, however :-)

though, the main reason was I didn't have any actual hardware to test on at the time.


speaking of FPGA NES' I have been spending some time rewriting it all in verilog. Originally it was in schematic capture. last night I finished converting over all the NES mappers I had implemented previously (around 200 or so) and the NES was converted and verified against the Blargg test ROMs and passed, so all that's left is some audio and cleanup before it's ready to go. (Also, I made a new dev board for the project which is alot smaller and fits in an NES cart case).
/* this is a comment */
Post Reply