PDA

View Full Version : General Porting Steps for a new Platform


enliteneer
26th June 2010, 09:19 PM
So I have a DE1 (cyclone II), but I'm wondering, in general, what it would take to run it on a different platform.

For example, the bemicro, http://www.hitex.com/index.php?id=1489 has a slightly smaller device, an altera cyclone iii (EP3C16 - 15k LEs, 56 M9K blocks, 504kb memory), but I'm thinking it should be able to run at least some of the smaller games... even if with no sound.

So in general, what would targeting a new fpga entail? Obviously, a similar resistor network for the vga as found on the de1 would have to be added to the bemicro board.. but what major tasks, like memory/timing would be involved?

Thanks!

RedskullDC
27th June 2010, 11:15 AM
Hi enliteneer,

So I have a DE1 (cyclone II), but I'm wondering, in general, what it would take to run it on a different platform.

For example, the bemicro, http://www.hitex.com/index.php?id=1489 has a slightly smaller device, an altera cyclone iii (EP3C16 - 15k LEs, 56 M9K blocks, 504kb memory), but I'm thinking it should be able to run at least some of the smaller games... even if with no sound.

So in general, what would targeting a new fpga entail? Obviously, a similar resistor network for the vga as found on the de1 would have to be added to the bemicro board.. but what major tasks, like memory/timing would be involved?

Thanks!

Not an awful lot of work is required to get pace running on another platform.
take a look in sw/src/target/de0 and also /synth/platform/midway8080/invaders/de0
This was a quick hack I did to target the terasic DE0 board, which is quite similar to the bemicro in terms of functionality, also Cyclone3 based.

The SRAM on the bemicro should require anything fancy, just use define PACE_HAS_SRAM = true in the project_pkg file and map the pins of the SRAM in QUARTUS.

I assume you are using the companion prototyping board with it?

You may find one of these:
http://www.nkcelectronics.com/vga-breakout-board-with-db15-female-connector-and-pin-head15.html
very handy in making a video interface :)

Hope this helps, ask if anything doesn't seem obvious.

Cheers,
Leslie

enliteneer
9th July 2010, 07:53 AM
Thanks a bunch! After a little tweaking of the PLL (the bemicro has a 16mhz on board), it works great, and that board from NKC was perfect!

How can I tell which other games would fit on a particular fpga?

Talus
10th July 2010, 01:09 PM
Well, block RAM is probably going to be the limiting factor. As a rule of thumb, I would say that any game that uses less combined ROM+RAM than available block RAM on the FPGA should be straight forward to get up and running.

If you use the external SRAM, then bigger games can of course fit.

RedskullDC
10th July 2010, 02:19 PM
Hi Enliteneer,
Thanks a bunch! After a little tweaking of the PLL (the bemicro has a 16mhz on board), it works great, and that board from NKC was perfect!

How can I tell which other games would fit on a particular fpga?

Good stuff!
Thanks for posting the pic.

With the resources on the BeMicro board, most of the PACE stuff shoud work fine.
Off the top of my head, only the Coco3 and Zet targets are likely to be a tight squeeze, but don't quote me on that :)

Cheers,
Red

tcdev
13th July 2010, 12:55 PM
As has already been mentioned, there's not a huge amount of work to do, especially for the Altera silicon.

In the most trivial cases, a new target_top.vhd and project_pkg.vhd are all that's required!

And please, feel free to submit the new files for inclusion in the PACE repository!

enliteneer
7th August 2010, 04:44 AM
It's been a while since my last visit, but I'm itchin to port a new game to the bemicro this weekend!

Attached are the modified files needed for the bemicro midway space invaders. I'm a bit embarrassed though, because I wasn't sure how to create a new platform that doesn't break all the file dependencies... in the end I just overwrote the de0 platform. Not pretty, but it should get anyone else with a bemicro up and running.

Hopefully I can get create a proper platform folder for the next bemicro game... pacman! I'll keep you posted!

enliteneer
7th August 2010, 08:22 PM
Pacman is working with it's own bemicro platform!

Things when much smoother this time around, but I am curious as to why (in project_pkg.vhd) setting all the memory sources to false still works?

constant PACE_HAS_SDRAM : boolean := false
constant PACE_HAS_FLASH : boolean := false;
constant PACE_HAS_SERIAL : boolean := false;
constant PACMAN_ROM_IN_SRAM : boolean := false;
constant PACMAN_USE_INTERNAL_WRAM : boolean := false;

I would think one of these should have set to true in order for the video engine to know where to load the rom data from, but apparently not!

In general, what files should I look at to see how this actually works... I assume video data is updated during vsync blanking, but it has to load it from flash/sram/internal just prior, no?

tcdev
9th August 2010, 09:40 AM
Pacman will use external SRAM for the CPU RAM ("work" RAM or 'wram') if the platform has SRAM.

There really needs to be two constants for each memory type...
PACE_HAS_SRAM and PACE_USES_SRAM.

PACE_HAS_SRAM should be defined in target_pkg.h
PACE_USES_SRAM should be defined/derived in project_pkg.h

I'm considering re-architecting the entire PACE project - PACE_V2 if you like - at some point in the near future. I'll try to make everything "right" and "nice" and "consistent" etc from the start...

tcdev
9th August 2010, 03:02 PM
As you may have noticed, I've added a new target - BeMicro.

Haven't had time to clean it up, but thought I'd just note that you should be able to use the existing Cyclone III 'generic' PLL in target_top, so you only need to specify the MULTIPLY & DIVIDE constants in project_pkg, rather than create a new PLL for each project.

enliteneer
20th August 2010, 09:20 PM
Thanks,

I've learned a bunch since starting, so I'm working on cleaning it up!

In addition, I'd like to add joystick control.. the bemicro has tons of gpio but doesn't have a ps/2 connector.. I could easily add a pushbutton type joystick that has 5 signals (each goes low when pushed in a direction).

Is there an interface that you recommend? The "inputs_i.jamma_n.*" seems to require a joystick with a clock to it, while the inputs_i.ps2_kclk,kdat/mclk,mdat look only for ps/2 interfaces! I didn't see a platform that uses this simple gpio type interface.

Cheers!

tcdev
21st August 2010, 03:52 PM
no clock required for jamma, just active low GPIO!