What MicroProcessor (of the ones listed) should I program in the FPGA (as the softcore proccesor)?
eZ80 (ZILOG)
 0%  [ 0 ]
8080 (INTEL)
 100%  [ 2 ]
Total Votes : 2

Hello there! I recently started a very, very ambitious project, read on and bare with me, I am fully aware of the complexity of this.

First of all it's a school project which means It has to be completed. Second it's a high school project so it's not for my study and therefor I am allowed to seek help.

The idea is to make a computer. Well, that is very vague isn't it? I am aiming for something like MS-DOS, not in complexity but in interface. Shortly said I am aiming for a CLI. Since I work on a FPGA I "only" have to make a OS.

Well actually a bit more. What I need at first is a processor, then second I need a Kernel and OS.

Let me first explain what it needs to be able to do:

-PS2 keyboard input (e.g a command)
-VGA lcd output (say I did 1 + 1 it then prints "2") on the screen

So I only need those to ports to work with altough it would be clever to have the other gates (RS232 and PMOD) supported.

So I thought first of all I need a instruction set for the SoftCore processor so I can write and program code for the SoftCore and then from there on build the OS and all the other peripherals.

So let me lay out my plans for the Instruction set.
---------------------------------------------------------------
ADD
SUB
MUL
DIV

RR -rotate right
RL -rotate left
RRC -rotate right carry
RLC -rotate left carry

SR -shift right
SL -shift left
SRC -shift right carry
SLC -shift left carry

AND
OR
NOT
XOR

JP -unconditional jump
JPFT [flag] -jump if [flag] is true
JPFF [flag] -jump if [flag] is false

PUSH
POP
LD
LEA --load effective addres (altough I currently have no idea what that means but obviously it is considered usefull)

IN --recieve data from a port over a register
OUT --send data from a register to the port (pins)
------------------------------------------------------------

First point: I bet I missed some usefull instructions, let me know if you think there is need for a couple of more instructions.

Now second point is: I was thinking about how many bits I would make my machine. 16 bits seems a little to few mostly because it can never adress the full 16MB of the onboard memory (both in Flash and SDRAM so 2x16MB basically) So then the second thought was 32, however I find that a bit of a overkill, if you think it's better then my plan (which is to make it 24bits) then let me know! The main reason I don't want 32 bits is because that lenghtens the opcodes and thus the execution cycle.

Now some more details about the registers I want to include. Single letter registers are 8 bits, double letter register are 16 bit (except PC and SP, program counter and stack pointer respectively, which are 24 bit). triple letter regs are 24 bits wide.

--------------------------------------------------------------------------------------
A --Accum
B --Backup
C --Counter (used for loops)
D --Data
F --Flag
-------------------------------------------------------------------------------------
IE --accum
HL --backup
MN --another backup
PC --program counter 24b
SP --stack pointer 24b
--------------------------------------------------------------------------------------
XOQ --accum
XRS --backup
XTU --backup
XVW --backup
XYZ --extended counter (used for loops)
--------------------------------------------------------------------------------------

So this is the mess I have atm, now I need to build a SoftCore processor out of it, then a OS on that and then a IDE on the OS so I can further develop on-FPGA.

All this is just a rough layout of what I intend to do, I have more detailed plans laying around but basically it comes down to this;

1. Does anyone have any good FPGA tutorials?
2. What do you think about the sofcore processor, is it doablez? are there enough instructions? should I make it more then or less then 24bits?
3. Any other point of cricism or help, maybe some experiences on this topic?
Wow, that _is_ an ambitious project.
Making a microprocessor is very hard. Do you have to make motherboards, ports for the mb, etc. ?

I think you should add the call, rst, and cp instructions
souvik1997 wrote:
Wow, that _is_ an ambitious project.


Seconded.

Now am I understanding this correctly when you say that you only need to make an OS, and not the microprocessor? If that's the case, and you are ok with it, the z80 might be a good platform (or the ez80). (You don't need to listen to me, probably wrong)

That aside, good luck with this!
FPGA allows you to design your own circuit and flash it to the chip, right? So you are designing your own processor and an OS to run on top of it? That's pretty intense, especially if you have never done either (and since you ask for an FPGA tutorial, I'm guessing you haven't?)

That's not to say don't do it - I think you could learn a tremendous amount from this! But it will probably also take a ton of effort and time. If you have the spare time to do that in, more power to you!
That seems like a huge amount of work. How long do you have to work on it?

I would personally go for an 8080-compatible instruction set. That would allow you to run CP/M on your computer. That would give you a disk operating system, a bunch of utilities and several existing pieces of software to run on it with a small amount of work. Of course, I may be biased in this field. Smile
I am also strongly in favor of replicating an existing microprocessor like the 8080 rather than trying to design your own uP from scratch, especially since it's a school project. Trust me, that will be hard enough in Verilog/VHDL before you even start in on software to run on top of the OS. In theory, of course, your FPGA will only be running the microprocessor core, and your actual code will be in RAM or Flash and be executed by your FPGA. There have been some enthusiast projects to emulate things like a z80 on FPGAs, so those might be helpful to check out.

Souvik, Player: An FPGA is basically a giant mass of reconfigurable logic gates on a single chip, and you write something akin to software in order to connect the gates together to do something useful. Thus, you can "write" a processor architecture in software, although of course something more limited and slower than if you etched a real processor.
Thanks for all the kind comments!

magicdanw wrote:
FPGA allows you to design your own circuit and flash it to the chip, right? So you are designing your own processor and an OS to run on top of it? That's pretty intense, especially if you have never done either (and since you ask for an FPGA tutorial, I'm guessing you haven't?)

That's not to say don't do it - I think you could learn a tremendous amount from this! But it will probably also take a ton of effort and time. If you have the spare time to do that in, more power to you!

Correct. As suggested by BenRyves and KermMartian it's better to build of towards a existing microprocessor, I can already see the advantages in doing that so I will if my teacher approves it (which he undoubtly will)

Quote:

That seems like a huge amount of work. How long do you have to work on it?

I would personally go for an 8080-compatible instruction set. That would allow you to run CP/M on your computer. That would give you a disk operating system, a bunch of utilities and several existing pieces of software to run on it with a small amount of work. Of course, I may be biased in this field.

Correct. it is pretty ambitious altough scrapping the OS and building towards a pre-existing microprocessor saves quite some time already, still I have got about 6 months to do it, that may seem alot but I have to do normal school alongside it not to forget my final exams coming this year! So I think I will have enough time to do it but it won't be by much (geez and then I was planning to write a Os...). I think i should be able to implent a fulling working microprocessor and system within about 2 months the rest is documanting and developing further on-FPGA.

Quote:

I am also strongly in favor of replicating an existing microprocessor like the 8080 rather than trying to design your own uP from scratch, especially since it's a school project. Trust me, that will be hard enough in Verilog/VHDL before you even start in on software to run on top of the OS. In theory, of course, your FPGA will only be running the microprocessor core, and your actual code will be in RAM or Flash and be executed by your FPGA. There have been some enthusiast projects to emulate things like a z80 on FPGAs, so those might be helpful to check out.

You don't even need a argument to convince me of building towards a pre-existing microprocessor, actually I am pretty surprised that I never thought of that myself but now that I do think of it I know its the right way to go.

Do you know how you can keep a certain "program" in the FPGA so it is not reset after reboot? I am also curios as to how I will be able to program the memory...through the processor? I honestly have no clue on how to do that...

Well anyway I need your opinion, will I go for the:

eZ80 (the FPGA timer is 50mhz so that is a perfect match!)
8080 (lots of existing software (and documentation), probaly the easier one)

I am not gonna let my choice entirely depend on this but if everyone would vote for the eZ80 I'd certainly would take it into deep consideration. Please let me know what you think is best![/quote]
The regular Z80 is binary-compatible with the 8080 (it was designed by one of the people who worked on the 8080), but adds some nice features (index registers, shadow registers, more flexible interrupt modes) and some CP/M software requires a Z80 (e.g. BBC BASIC). A Z80 may be a nice middle-ground between the 8080 and eZ80, at least as a starting point.
benryves wrote:
The regular Z80 is binary-compatible with the 8080 (it was designed by one of the people who worked on the 8080), but adds some nice features (index registers, shadow registers, more flexible interrupt modes) and some CP/M software requires a Z80 (e.g. BBC BASIC). A Z80 may be a nice middle-ground between the 8080 and eZ80, at least as a starting point.
Excellent, I was going to opine something similar. I think the eZ80 would be significant overkill for this project, and since it has binary compatibility with z80 code, I think a z80 would be a better choice. The 8080 might be overly simplistic for not much less work.
Ok I'll do the Z80 then! Still my other question remains: any good resources? Believe me, I did do quite some searching for myself, i did fond 'The VHDL Cookbook' but It's not really my cup of tea...

There are some fora around but most seem to be dead, I am merely asking if anybody has some resources available that I could take a look at (e.g. a pdf or something)
I'm afraid I can't think of any resource offhand, other than grabbing some z80 documentation on opcodes, flags, and registers, and starting from there.
@Matthias1992: Here's a couple of resources you may wish to peruse if you're serious about doing this (and just so you know, the level of complexity of the project you're undertaking is common for a masters-level EE/CpE degree project):

http://courses.ncsu.edu/ece406/lec/001/
http://courses.ncsu.edu/ece521/common/
thanks all!

I guess I have to dive back into z80 asm programming...this means I have a excuse to program for calcs! currently I just intend on getting TI-z80 asm under control, then go trough some VHDL and then, using the instruction set, make a softcore processor...

But before that I plan to release a library for the calculators to train my z80 asm skills...curious already?
Of course curious! Just make sure it works happily with or under Doors CS, and you'll have my blessing. Smile
amen to that Very Happy
Matthias1992 wrote:
amen to that Very Happy
So basically I'm extremely curious; I hope to get some details soon. Wink And I hope your project is progressing smoothyl.
So, how is this going?
_player1537 wrote:
So, how is this going?
An excellent question; I started to wonder the same when tanner mentioned this evening that he was looking for your topic.
KermMartian wrote:
_player1537 wrote:
So, how is this going?
An excellent question; I started to wonder the same when tanner mentioned this evening that he was looking for your topic.


.......What? tanner is _player1537 and this isn't his topic Razz

Also, I'm pretty sure this project is one of many Vaporware™ projects posted on Cemetech.
Actually, I am making progress. Albeit in a completely different way then described above. I managed to download a PicoBlaze onto the FPGA. Now I can program in KCPSM3 Assembly which is a relief after all the VHDL coding (mostly adjustments, I just downloaded the PicoBlaze).

There are three more obstacles.

> Implenting VGA support (I have found a module but I don't know how to implent it)
> Implenting PS2 support (For keyboard)
> Implenting several independent PicoBlaze cores (I can have up to 50 which means I could do a 50-core system. I think I'll go with dual or quad core first though (several cores are needed to bypass the 1024 instructions limit on every instance of the soft-core))

Sorry for the necropost btw. But I think its worthwhile.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement