project on FPGA - Page 1
Forum section: electronics / general

author: sagnikbasu
author_rank: Contributor
timestamp: January 26, 2017, 01:40:22 pm
content: Is there any guide where I can learn how to implement a 8 bit micro controller architecture in FPGA ?

author: chris_leyson
author_rank: Super Contributor
timestamp: January 26, 2017, 01:42:28 pm
content: Xilinx PicoBlaze is a good place to start.

author: sagnikbasu
author_rank: Contributor
timestamp: January 26, 2017, 02:09:18 pm
content: PicoBlaze is fine....Is there any guide where I can learn to design my own micro-controller in FPGA using HDL ?

author: legacy
author_rank: Super Contributor
timestamp: January 26, 2017, 02:34:04 pm
content: Quote from: sagnikbasu on January 26, 2017, 01:40:22 pmI have a book about that, for sale, on ebay

author: Scrts
author_rank: Frequent Contributor
timestamp: January 26, 2017, 04:21:51 pm
content: I am amazed that people are still interested in this... Unless you are a student and targeting to do design work in the future.

author: RoGeorge
author_rank: Super Contributor
timestamp: January 26, 2017, 05:11:44 pm
content: Just in case you need some exampleshttps://opencores.org/projects

author: rstofer
author_rank: Super Contributor
timestamp: January 26, 2017, 05:18:27 pm
content: Quote from: Scrts on January 26, 2017, 04:21:51 pmThere are certainly a lot of developed cores available on OpenCores or from the FPGA manufacturers. There are also a lot of individual projects that are well documented. Notably the T80 core (Z80) which makes a wonderful core for Arcade Games like PacMan. Or running CP/M on a smokin' processor.Here's another reason: Suppose when you were a young fellow back around '70, you had unlimited access to an IBM 1130 computer complete with drum plotter and, incidentally, you had a copy of the Electronic Circuit Analysis Program (ECAP) all the time you were in EE school? Pretty cool! I loved that machine... Bode' plots were pretty straightforward: Use ECAP to produce the AC analysis and stuff the results into a custom plotting program. We even had log-log paper!So, I built one in an FPGA that clocks at 125x and runs ALL of the original software, unmodified. I still code in FORTRAN on both the 1130 and the PC.I have a LOT of books on CPU design, that was my major in grad school. I ate that stuff for breakfast! Alas, that was a long time ago...Of the books, one of the most interesting is "Microprocessor Design Using Verilog HDL" by Monte Dalrymple. The author takes a unique approach to defining the various states and decoding of instructions by using Excel spreadsheets. Lots of spreadsheets! It's truly elegant. The design revolves around the Z80.https://www.amazon.com/Microprocessor-Design-Using-Verilog-HDL/dp/0963013351There are a number of good books re: Verilog. I use VHDL so I really don't want to get into recommending something I haven't read.Another interesting book "The Elements of Computing Systems" by Nisan and Schocken starts with the basic NAND gate and works up to a complete operating system. The only 'givens' are a 2 input NAND gate and an Inverter, now design a complete CPU including memory (program and data). This won't be an elegant CPU and the instruction set is truly minimal but, after a bit of work, you will have a working CPU even if it is software. At that point you transition to a provided CPU emulation and work on writing an assembler (the provided emulation is much faster than interpreting a barn full of logic at each step). Once the assembler is complete, you write a compiler for a stack type language (the CPU is stack oriented) complete with all the issues of heap, stack and frames followed by writing an OS. I have gotten as far as completing the assembler. Yes, a few people have implemented the CPU on an FPGA. FWIW: Microsoft Visual Studio Community Edition C# works well for writing the assembler and it's free!https://www.amazon.com/Elements-Computing-Systems-Building-Principles/dp/0262640686/ref=mt_paperback

author: james_s
author_rank: Super Contributor
timestamp: January 26, 2017, 07:57:24 pm
content: Much can be learned by designing and implementing your own processor, it's one of my goals to do some day. For the time being I'm using existing CPU softcores in my FPGA projects. I've got a number of arcade games running, and several retro computers, even one that runs CP/M on a $14 FPGA board.

author: Scrts
author_rank: Frequent Contributor
timestamp: January 26, 2017, 08:14:50 pm
content: Quote from: james_s on January 26, 2017, 07:57:24 pmThis is where I was going to... When I had myself a task to do something, then I only worked on it. Mostly ethernet and video broadcasting stuff, but surely I did not write my own CPU when there was one just there for free.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: January 27, 2017, 10:16:19 am
content: I am currently studying CPU Architecture. Perhaps my YouTube Playlist will help you (start at the end).https://www.youtube.com/playlist?list=PLSJAmtVQiOk9uYQQByxMrO3eKN4LYeWEGI am first studying the theory and with that getting new ideas for my CPU design for which I take notes in a design document. My idea is somewhat non-mainstream so I have to filter and sift through the typical material.Also wikipedia has many articles on different types of CPU architecture that can shed light on the basics architecture styles/types.Good luck.

author: BrianHG
author_rank: Super Contributor
timestamp: January 27, 2017, 10:09:34 pm
content: Take a look at Opencores.org. Look under microcontrolers.http://opencores.org/If i remember correctly, you should find Verilog & VHDL examples of full mcu like PICs, arm and others, as well as custom microcontrolers with compilers.You can also find all the parts to the processors, like ALU units, MMU units, DSPs, ect...

author: JPortici
author_rank: Super Contributor
timestamp: January 28, 2017, 09:28:12 am
content: Quote from: Scrts on January 26, 2017, 04:21:51 pmi am amazed that people still do new z80 home computer boardsthough, i understand why they may do it.and if (when) i will start with FPGA at some point i will try an implement an mcu on it

author: james_s
author_rank: Super Contributor
timestamp: January 28, 2017, 07:21:13 pm
content: Why is it amazing that people build systems around old chips? People still spin yarn out of wool, still make butter out of cream by hand, people do all sorts of things that are technically obsolete. Modern computers are extremely complex and it can help tremendously in understanding them to take a step back to simpler times and gain an understanding of the ancestors of modern computers. You probably couldn't reasonably build a Pentium system on a breadboard but a Z80 or 6502 computer is feasible.

author: rstofer
author_rank: Super Contributor
timestamp: January 28, 2017, 09:34:52 pm
content: Quote from: JPortici on January 28, 2017, 09:28:12 amThe 8080 based Altair 8800 ran at 2 MHz and the later Z80 systems ran at the blistering speed of 6 MHz. Today you can buy a Z80 chip that runs at 50 MHz and you can probably build one that runs at 100 MHz. Then add in an operating system like CP/M with a Compact Flash to implement all 16 logical drives and you have a pretty nice machine with a command line user interface. In fact, it smokes!I still have all of the CP/M related software including PL/I and FORTRAN. I primarily use the Macro Assembler and WordStar as an editor. Anything but 'ed'... Were I truly interested, I might try to resurrect UCSD Pascal and see how it would run on a 50 MHz board. It would be awesome!I bought one of the Zilog 50 MHz boards, added an identical sized daughter card with two USB ports for the console, reader and printer and a Compact Flash socket. This is a very nice system.These retro computers are a lot of fun. To build them, you need decent hardware skills to design and build the interfaces (if you use a manufactured board), solid coding skills to write the BIOS and boot loader and, if you are creating the core, very solid FPGA skills. These are NOT Arduino projects!Or, you can use the advanced hardware features of the modern Z80 chip to build a robot, running the 'bot under CP/M and writing the code in Microsoft FORTRAN! That's about as retro as it gets! If you do the core on an FPGA, you can add all the PWM ports you want. Wheel encoders are trivial.Once again, I'm going to mention "Microprocessor Design Using Verilog HDL" because the fellow who wrote it worked for Zilog on advanced Z80 chips. Write your own Z80 or copy the T80 core from OpenCores and see how far you can get.

author: JPortici
author_rank: Super Contributor
timestamp: January 29, 2017, 01:21:09 am
content: Quote from: rstofer on January 28, 2017, 09:34:52 pmduh!can't people recognize sarcasm?Quotethanks for mentioning it, i always forget the name of dat book. (not sarcasm. i really want to buy it, sooner or later)

author: legacy
author_rank: Super Contributor
timestamp: January 29, 2017, 10:54:13 am
content: I havethisbook for sale on ebay.

author: John_ITIC
author_rank: Frequent Contributor
timestamp: January 29, 2017, 07:15:15 pm
content: Quote from: sagnikbasu on January 26, 2017, 01:40:22 pmYes, take a look at this PIC IP Core I designed years back. It comes with full Verilog HDL and detailed PDF documentation but without support (no time for that):http://summitsoftconsulting.com/Pic10IpCore.htmAlso, many college-level books use CPU cores as example projects. Check amazon.com