FPGARelated.com
Forums

Advice to a newbie

Started by Cecil Bayona May 27, 2016
I a retired person with limited resources and I've always been 
interested in CPU design, so now that I have time I wanted to give it a 
go using FPGAs to design simple CPUs.

I would like some advice on several topics, one being which HDL language 
to learn first, although Verilog seems simpler I've read articles that 
encourages beginners to start with VHDL, although it seems more wordy, I 
believe it will help eliminate more dumb mistakes so I'm leaning that 
way. What is your advice?

Another is which logic families/companies make products that are 
inexpensive and have good features useful in creating CPUs and DSP type 
products as I also am interested in Software Defined Radios.

I have purchase for a starter kit a Lattice Brevia2 kit as it was 
inexpensive and has low power consumption, so I assume will be easier to 
use in the beginning. It's a simple device with 5K LUTs which seems to 
be enough for some of the simple processors that I'm interested in to 
start with, CPUs such as the J1 for starters. From some time back I've 
have a Xilinx Spartan 3 Started kit that I have not used, I plan to use 
it later for more complex designs.

Your opinions and advice is welcomed.
-- 
Cecil - k5nwa
On Fri, 27 May 2016 13:00:28 -0500, Cecil Bayona wrote:

> I a retired person with limited resources and I've always been > interested in CPU design, so now that I have time I wanted to give it a > go using FPGAs to design simple CPUs. > > I would like some advice on several topics, one being which HDL language > to learn first, although Verilog seems simpler I've read articles that > encourages beginners to start with VHDL, although it seems more wordy, I > believe it will help eliminate more dumb mistakes so I'm leaning that > way. What is your advice? > > Another is which logic families/companies make products that are > inexpensive and have good features useful in creating CPUs and DSP type > products as I also am interested in Software Defined Radios. > > I have purchase for a starter kit a Lattice Brevia2 kit as it was > inexpensive and has low power consumption, so I assume will be easier to > use in the beginning. It's a simple device with 5K LUTs which seems to > be enough for some of the simple processors that I'm interested in to > start with, CPUs such as the J1 for starters. From some time back I've > have a Xilinx Spartan 3 Started kit that I have not used, I plan to use > it later for more complex designs. > > Your opinions and advice is welcomed.
Verilog if you're on the west coast, VHDL if east. I'm not sure about Texas, though. Seriously, it's a lot more important to understand how to design than to pick the right language. You can do crappy work in either one, and you can do good work in either one. -- Tim Wescott Control systems, embedded software and circuit design I'm looking for work! See my website if you're interested http://www.wescottdesign.com
On 5/27/2016 4:15 PM, Tim Wescott wrote:
> On Fri, 27 May 2016 13:00:28 -0500, Cecil Bayona wrote: > >> I a retired person with limited resources and I've always been >> interested in CPU design, so now that I have time I wanted to give it a >> go using FPGAs to design simple CPUs. >> >> I would like some advice on several topics, one being which HDL language >> to learn first, although Verilog seems simpler I've read articles that >> encourages beginners to start with VHDL, although it seems more wordy, I >> believe it will help eliminate more dumb mistakes so I'm leaning that >> way. What is your advice? >> >> Another is which logic families/companies make products that are >> inexpensive and have good features useful in creating CPUs and DSP type >> products as I also am interested in Software Defined Radios. >> >> I have purchase for a starter kit a Lattice Brevia2 kit as it was >> inexpensive and has low power consumption, so I assume will be easier to >> use in the beginning. It's a simple device with 5K LUTs which seems to >> be enough for some of the simple processors that I'm interested in to >> start with, CPUs such as the J1 for starters. From some time back I've >> have a Xilinx Spartan 3 Started kit that I have not used, I plan to use >> it later for more complex designs. >> >> Your opinions and advice is welcomed. > > Verilog if you're on the west coast, VHDL if east. I'm not sure about > Texas, though. > > Seriously, it's a lot more important to understand how to design than to > pick the right language. You can do crappy work in either one, and you > can do good work in either one. >
Hardware design I understand, I put together my own CPU design and built it with Schottky logic, and it worked rather well. But as to Verilog or VHDL I know zip. I do have a couple of books on the subject of FPGA programing but I don't think of them as any good. They go into the tiny details such on how to make an adder but contains little on the overall structure and how to design anything of consequence. Are there any books or Internet sources on the subject of overall design with FPGAs? I would be specifically interested on CPU design using HDL. Thanks -- Cecil - k5nwa
On Fri, 27 May 2016 16:53:12 -0500, Cecil Bayona wrote:

> On 5/27/2016 4:15 PM, Tim Wescott wrote: >> On Fri, 27 May 2016 13:00:28 -0500, Cecil Bayona wrote: >> >>> I a retired person with limited resources and I've always been >>> interested in CPU design, so now that I have time I wanted to give it >>> a go using FPGAs to design simple CPUs. >>> >>> I would like some advice on several topics, one being which HDL >>> language to learn first, although Verilog seems simpler I've read >>> articles that encourages beginners to start with VHDL, although it >>> seems more wordy, I believe it will help eliminate more dumb mistakes >>> so I'm leaning that way. What is your advice? >>> >>> Another is which logic families/companies make products that are >>> inexpensive and have good features useful in creating CPUs and DSP >>> type products as I also am interested in Software Defined Radios. >>> >>> I have purchase for a starter kit a Lattice Brevia2 kit as it was >>> inexpensive and has low power consumption, so I assume will be easier >>> to use in the beginning. It's a simple device with 5K LUTs which seems >>> to be enough for some of the simple processors that I'm interested in >>> to start with, CPUs such as the J1 for starters. From some time back >>> I've have a Xilinx Spartan 3 Started kit that I have not used, I plan >>> to use it later for more complex designs. >>> >>> Your opinions and advice is welcomed. >> >> Verilog if you're on the west coast, VHDL if east. I'm not sure about >> Texas, though. >> >> Seriously, it's a lot more important to understand how to design than >> to pick the right language. You can do crappy work in either one, and >> you can do good work in either one. >> > Hardware design I understand, I put together my own CPU design and built > it with Schottky logic, and it worked rather well. But as to Verilog or > VHDL I know zip. I do have a couple of books on the subject of FPGA > programing but I don't think of them as any good. They go into the tiny > details such on how to make an adder but contains little on the overall > structure and how to design anything of consequence. > > Are there any books or Internet sources on the subject of overall design > with FPGAs? I would be specifically interested on CPU design using HDL.
Look for books with "Computer Systems Architecture" either in or as the title. they will not and should not mention FPGAs -- by the time you're making architectural decisions you probably shouldn't be too worried about what the underlying technology is. Then, get your hands on data sheets for as many different processors as you can and see how they did it. Think of strengths and weaknesses, and why the designers might have done what they did. And let me indulge myself with a shout-out to the RCA COSMAC 1802 processor. It was the first thing I ever wrote assembly for, and you could practically draw the control logic from the instruction set. I dimly remember (meaning that I saw it between two days and two decades ago) that there's an FPGA version of the core that's at least byte- accurate, if maybe not clock-cycle accurate. In these days of RISC computers, it's nice to be familiar with a NHISC (Never Had an Instruction Set) computer. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com I'm looking for work -- see my website!
Cecil, here's a very simple 8-bit CPU I designed, called Oppie-1.  It
compiles in Verilog and in Altera's Quartus II software.  I have not
validated it, so it's probably buggy.  But, it may be interesting to
look at it.

    https://github.com/RickCHodgin/libsf/tree/master/li386/oppie/oppie1

Best regards,
Rick C. Hodgin
On 5/27/2016 5:35 PM, Tim Wescott wrote:
> On Fri, 27 May 2016 16:53:12 -0500, Cecil Bayona wrote: > >> On 5/27/2016 4:15 PM, Tim Wescott wrote: >>> On Fri, 27 May 2016 13:00:28 -0500, Cecil Bayona wrote: >>> >>>> I a retired person with limited resources and I've always been >>>> interested in CPU design, so now that I have time I wanted to give it >>>> a go using FPGAs to design simple CPUs. >>>> >>>> I would like some advice on several topics, one being which HDL >>>> language to learn first, although Verilog seems simpler I've read >>>> articles that encourages beginners to start with VHDL, although it >>>> seems more wordy, I believe it will help eliminate more dumb mistakes >>>> so I'm leaning that way. What is your advice? >>>> >>>> Another is which logic families/companies make products that are >>>> inexpensive and have good features useful in creating CPUs and DSP >>>> type products as I also am interested in Software Defined Radios. >>>> >>>> I have purchase for a starter kit a Lattice Brevia2 kit as it was >>>> inexpensive and has low power consumption, so I assume will be easier >>>> to use in the beginning. It's a simple device with 5K LUTs which seems >>>> to be enough for some of the simple processors that I'm interested in >>>> to start with, CPUs such as the J1 for starters. From some time back >>>> I've have a Xilinx Spartan 3 Started kit that I have not used, I plan >>>> to use it later for more complex designs. >>>> >>>> Your opinions and advice is welcomed. >>> >>> Verilog if you're on the west coast, VHDL if east. I'm not sure about >>> Texas, though. >>> >>> Seriously, it's a lot more important to understand how to design than >>> to pick the right language. You can do crappy work in either one, and >>> you can do good work in either one. >>> >> Hardware design I understand, I put together my own CPU design and built >> it with Schottky logic, and it worked rather well. But as to Verilog or >> VHDL I know zip. I do have a couple of books on the subject of FPGA >> programing but I don't think of them as any good. They go into the tiny >> details such on how to make an adder but contains little on the overall >> structure and how to design anything of consequence. >> >> Are there any books or Internet sources on the subject of overall design >> with FPGAs? I would be specifically interested on CPU design using HDL. > > Look for books with "Computer Systems Architecture" either in or as the > title. they will not and should not mention FPGAs -- by the time you're > making architectural decisions you probably shouldn't be too worried > about what the underlying technology is. > > Then, get your hands on data sheets for as many different processors as > you can and see how they did it. Think of strengths and weaknesses, and > why the designers might have done what they did. > > And let me indulge myself with a shout-out to the RCA COSMAC 1802 > processor. It was the first thing I ever wrote assembly for, and you > could practically draw the control logic from the instruction set. I > dimly remember (meaning that I saw it between two days and two decades > ago) that there's an FPGA version of the core that's at least byte- > accurate, if maybe not clock-cycle accurate. In these days of RISC > computers, it's nice to be familiar with a NHISC (Never Had an > Instruction Set) computer. >
It looks like I didn't make myself clear enough on what I was looking for, I was looking for books or articles on FPGA programming that discusses how to use the software to program the FPGA to create CPU features. I already own a few books and have many articles on CPU architecture, plus books and literature on CPU instruction sets. Is there literature,basically a primer on how to create a simple CPU in HDL, preferably in VHDL? The alternative is that I will need to do it on my own by looking at a simple example such as the J1 , ep16, or the B16 CPUs and see what they are doing to create the CPU hardware blocks. The J1 is a pretty simple CPU done in less than 250 Verilog statements, the instructions are are bits controlling the various hardware features with no decoding of the instructions.The J16 is done in VHDL using a Lattice Brevia2 so it should run as is, the disadvantage is that it's more complex plus it's created by someone who is not very experienced. All three already have a compiler available to write software to test them. The disadvantage to all these simple CPUs is that there is no documentation to the software that creates the devices so as a rank beginner it will be difficult to see what they are doing. Thanks -- Cecil - k5nwa
On 5/27/2016 8:27 PM, Cecil Bayona wrote:
> On 5/27/2016 5:35 PM, Tim Wescott wrote: >> On Fri, 27 May 2016 16:53:12 -0500, Cecil Bayona wrote: >> >>> On 5/27/2016 4:15 PM, Tim Wescott wrote: >>>> On Fri, 27 May 2016 13:00:28 -0500, Cecil Bayona wrote: >>>> >>>>> I a retired person with limited resources and I've always been >>>>> interested in CPU design, so now that I have time I wanted to give it >>>>> a go using FPGAs to design simple CPUs. >>>>> >>>>> I would like some advice on several topics, one being which HDL >>>>> language to learn first, although Verilog seems simpler I've read >>>>> articles that encourages beginners to start with VHDL, although it >>>>> seems more wordy, I believe it will help eliminate more dumb mistakes >>>>> so I'm leaning that way. What is your advice? >>>>> >>>>> Another is which logic families/companies make products that are >>>>> inexpensive and have good features useful in creating CPUs and DSP >>>>> type products as I also am interested in Software Defined Radios. >>>>> >>>>> I have purchase for a starter kit a Lattice Brevia2 kit as it was >>>>> inexpensive and has low power consumption, so I assume will be easier >>>>> to use in the beginning. It's a simple device with 5K LUTs which seems >>>>> to be enough for some of the simple processors that I'm interested in >>>>> to start with, CPUs such as the J1 for starters. From some time back >>>>> I've have a Xilinx Spartan 3 Started kit that I have not used, I plan >>>>> to use it later for more complex designs. >>>>> >>>>> Your opinions and advice is welcomed. >>>> >>>> Verilog if you're on the west coast, VHDL if east. I'm not sure about >>>> Texas, though. >>>> >>>> Seriously, it's a lot more important to understand how to design than >>>> to pick the right language. You can do crappy work in either one, and >>>> you can do good work in either one. >>>> >>> Hardware design I understand, I put together my own CPU design and built >>> it with Schottky logic, and it worked rather well. But as to Verilog or >>> VHDL I know zip. I do have a couple of books on the subject of FPGA >>> programing but I don't think of them as any good. They go into the tiny >>> details such on how to make an adder but contains little on the overall >>> structure and how to design anything of consequence. >>> >>> Are there any books or Internet sources on the subject of overall design >>> with FPGAs? I would be specifically interested on CPU design using HDL. >> >> Look for books with "Computer Systems Architecture" either in or as the >> title. they will not and should not mention FPGAs -- by the time you're >> making architectural decisions you probably shouldn't be too worried >> about what the underlying technology is. >> >> Then, get your hands on data sheets for as many different processors as >> you can and see how they did it. Think of strengths and weaknesses, and >> why the designers might have done what they did. >> >> And let me indulge myself with a shout-out to the RCA COSMAC 1802 >> processor. It was the first thing I ever wrote assembly for, and you >> could practically draw the control logic from the instruction set. I >> dimly remember (meaning that I saw it between two days and two decades >> ago) that there's an FPGA version of the core that's at least byte- >> accurate, if maybe not clock-cycle accurate. In these days of RISC >> computers, it's nice to be familiar with a NHISC (Never Had an >> Instruction Set) computer. >> > It looks like I didn't make myself clear enough on what I was looking > for, I was looking for books or articles on FPGA programming that > discusses how to use the software to program the FPGA to create CPU > features. I already own a few books and have many articles on CPU > architecture, plus books and literature on CPU instruction sets. > > Is there literature,basically a primer on how to create a simple CPU in > HDL, preferably in VHDL? > > The alternative is that I will need to do it on my own by looking at a > simple example such as the J1 , ep16, or the B16 CPUs and see what they > are doing to create the CPU hardware blocks. The J1 is a pretty simple > CPU done in less than 250 Verilog statements, the instructions are are > bits controlling the various hardware features with no decoding of the > instructions.The J16 is done in VHDL using a Lattice Brevia2 so it > should run as is, the disadvantage is that it's more complex plus it's > created by someone who is not very experienced. All three already have a > compiler available to write software to test them.
Sorry it the ep16 instead of the J16 that is in VHDL and uses a Lattice Brevia2 board.
> > The disadvantage to all these simple CPUs is that there is no > documentation to the software that creates the devices so as a rank > beginner it will be difficult to see what they are doing. > > Thanks
-- Cecil - k5nwa
On 5/27/2016 2:00 PM, Cecil Bayona wrote:
> I a retired person with limited resources and I've always been > interested in CPU design, so now that I have time I wanted to give it a > go using FPGAs to design simple CPUs. > > I would like some advice on several topics, one being which HDL language > to learn first, although Verilog seems simpler I've read articles that > encourages beginners to start with VHDL, although it seems more wordy, I > believe it will help eliminate more dumb mistakes so I'm leaning that > way. What is your advice? > > Another is which logic families/companies make products that are > inexpensive and have good features useful in creating CPUs and DSP type > products as I also am interested in Software Defined Radios. > > I have purchase for a starter kit a Lattice Brevia2 kit as it was > inexpensive and has low power consumption, so I assume will be easier to > use in the beginning. It's a simple device with 5K LUTs which seems to > be enough for some of the simple processors that I'm interested in to > start with, CPUs such as the J1 for starters. From some time back I've > have a Xilinx Spartan 3 Started kit that I have not used, I plan to use > it later for more complex designs. > > Your opinions and advice is welcomed.
This does not directly address your stated issues, but there is a workshop Saturday. Notable is that it will use the same starter kit you have. I believe you can participate via the Internet. It might be interesting to you since it is about CPU design. Here is a post I made about this in another group. Dr. Ting will be leading a workshop on using a Lattice FPGA to implement an emulation of the 8080 instruction set which will run Forth. http://www.meetup.com/SV-FIG/events/229926249/ I believe you need to be a member of Meetup to see this page. I'm not sure but you may need to be a member of the SVFIG meetup group as well. There is no charge to join either. -- Rick C
On Friday, May 27, 2016 at 8:27:34 PM UTC-5, Cecil Bayona wrote:
> On 5/27/2016 5:35 PM, Tim Wescott wrote: > > On Fri, 27 May 2016 16:53:12 -0500, Cecil Bayona wrote: > > > >> On 5/27/2016 4:15 PM, Tim Wescott wrote: > >>> On Fri, 27 May 2016 13:00:28 -0500, Cecil Bayona wrote: > >>> > >>>> I a retired person with limited resources and I've always been > >>>> interested in CPU design, so now that I have time I wanted to give it > >>>> a go using FPGAs to design simple CPUs. > >>>> > >>>> I would like some advice on several topics, one being which HDL > >>>> language to learn first, although Verilog seems simpler I've read > >>>> articles that encourages beginners to start with VHDL, although it > >>>> seems more wordy, I believe it will help eliminate more dumb mistakes > >>>> so I'm leaning that way. What is your advice? > >>>> > >>>> Another is which logic families/companies make products that are > >>>> inexpensive and have good features useful in creating CPUs and DSP > >>>> type products as I also am interested in Software Defined Radios. > >>>> > >>>> I have purchase for a starter kit a Lattice Brevia2 kit as it was > >>>> inexpensive and has low power consumption, so I assume will be easier > >>>> to use in the beginning. It's a simple device with 5K LUTs which seems > >>>> to be enough for some of the simple processors that I'm interested in > >>>> to start with, CPUs such as the J1 for starters. From some time back > >>>> I've have a Xilinx Spartan 3 Started kit that I have not used, I plan > >>>> to use it later for more complex designs. > >>>> > >>>> Your opinions and advice is welcomed. > >>> > >>> Verilog if you're on the west coast, VHDL if east. I'm not sure about > >>> Texas, though. > >>> > >>> Seriously, it's a lot more important to understand how to design than > >>> to pick the right language. You can do crappy work in either one, and > >>> you can do good work in either one. > >>> > >> Hardware design I understand, I put together my own CPU design and built > >> it with Schottky logic, and it worked rather well. But as to Verilog or > >> VHDL I know zip. I do have a couple of books on the subject of FPGA > >> programing but I don't think of them as any good. They go into the tiny > >> details such on how to make an adder but contains little on the overall > >> structure and how to design anything of consequence. > >> > >> Are there any books or Internet sources on the subject of overall design > >> with FPGAs? I would be specifically interested on CPU design using HDL. > > > > Look for books with "Computer Systems Architecture" either in or as the > > title. they will not and should not mention FPGAs -- by the time you're > > making architectural decisions you probably shouldn't be too worried > > about what the underlying technology is. > > > > Then, get your hands on data sheets for as many different processors as > > you can and see how they did it. Think of strengths and weaknesses, and > > why the designers might have done what they did. > > > > And let me indulge myself with a shout-out to the RCA COSMAC 1802 > > processor. It was the first thing I ever wrote assembly for, and you > > could practically draw the control logic from the instruction set. I > > dimly remember (meaning that I saw it between two days and two decades > > ago) that there's an FPGA version of the core that's at least byte- > > accurate, if maybe not clock-cycle accurate. In these days of RISC > > computers, it's nice to be familiar with a NHISC (Never Had an > > Instruction Set) computer. > > > It looks like I didn't make myself clear enough on what I was looking > for, I was looking for books or articles on FPGA programming that > discusses how to use the software to program the FPGA to create CPU > features. I already own a few books and have many articles on CPU > architecture, plus books and literature on CPU instruction sets. > > Is there literature,basically a primer on how to create a simple CPU in > HDL, preferably in VHDL? > > The alternative is that I will need to do it on my own by looking at a > simple example such as the J1 , ep16, or the B16 CPUs and see what they > are doing to create the CPU hardware blocks. The J1 is a pretty simple > CPU done in less than 250 Verilog statements, the instructions are are > bits controlling the various hardware features with no decoding of the > instructions.The J16 is done in VHDL using a Lattice Brevia2 so it > should run as is, the disadvantage is that it's more complex plus it's > created by someone who is not very experienced. All three already have a > compiler available to write software to test them. > > The disadvantage to all these simple CPUs is that there is no > documentation to the software that creates the devices so as a rank > beginner it will be difficult to see what they are doing. > > Thanks > -- > Cecil - k5nwa
]>The disadvantage to all these simple CPUs is that there is no ]> documentation to the software that creates the devices so as a rank ]> beginner it will be difficult to see what they are doing. Did a presentation in March directed towards this problem. The idea is to do the simplest possible soft core processor (done here in VHDL). It helps to use the fewest lines of code. The PDF of the slides is at: http://opencores.org/project,rois,downloads "DIY soft-core processor" Full VHDL code is available on the Overview section. Only four instructions are implemented (didn't want to make it too easy for students). If you enjoy doing test cases and would like to help, send an e-mail. Jim Brakefield
On 5/27/2016 10:10 PM, rickman wrote:
>> Your opinions and advice is welcomed. > > This does not directly address your stated issues, but there is a > workshop Saturday. Notable is that it will use the same starter kit you > have. I believe you can participate via the Internet. It might be > interesting to you since it is about CPU design. Here is a post I made > about this in another group. > > Dr. Ting will be leading a workshop on using a Lattice FPGA to implement > an emulation of the 8080 instruction set which will run Forth. > > http://www.meetup.com/SV-FIG/events/229926249/ > > I believe you need to be a member of Meetup to see this page. I'm not > sure but you may need to be a member of the SVFIG meetup group as well. > There is no charge to join either. >
Thanks, I already joined, that is the reason for buying the Lattice Brevia2, I will be watching the meeting, but the video is supposed to be available afterwards so I can take my time afterwards and go through the course at my pace. I loaded Diamond on a Virtual Windows 7 partition and setup the ep8080 project and noticed that the software warned of a clock issue, Dr Ting mentioned that he was having issues where if he made changes things would break so that clock issue might be related. I been looking at some video courses and they had a lot of information on translating a set of hardware into VHDL code, so over the next few weeks I will be trying the lessons to become familiar with VHDL. In the meantime I will also be looking for books on VHDL and how to use it to create hardware. I have done hardware design some time back and I still like doing so but I'm hoping that once I become more familiar with FPGAs I can do more experimenting as buy once and try out many times is perfect for experimenting. -- Cecil - k5nwa