Ok, so I’m learning Forth and Verilog… i’m not proficient in neither, but I like to learn
With all due respect, you are trying to make too many and too big steps at once.
IOW in your shoes I would first learn to set up and run a Forth system on a small MCU
like Arduinos to get the feeling.
In parallel dive deeper into Verilog, f.ex. by studying this project: http://mindworks.shoutwiki.com/wiki/Forth_Computing_on_FPGA
Ok, so I’m learning Forth and Verilog… i’m not proficient in neither, but I like to learn and hack stuff, I built my first module on Verilog as a staring point for a Forth FPGA… https://gist.githubusercontent.com/jemo07/5d5ba7d31bb12410888f46ca6060a1f2/raw/1c597704a9a8f4f99b3e73a3906905ef0f38c358/ProgramCounter.v
This is my cheesy Program counter, I know, don’t laugh… :D.Operating Instructions *Opcodes. The JIT in essence becomes the compiler and the code is run native.
Ok, while I started this several weeks ago, I have a simple question… what do HW Forth implementations really do? I mean, I understand a picoJava, as it’s executing “bitecode,” and you remove the interpreter as the bite-codes map 1:1 to the
Now, for Forth, how does that work out? If the outer interpreter is a JIT, it then compiles the words into core words *who are in term just Opcodes. In essence, is all we are saying that when you write native Forth, you are really writing complied code?
I ask this, as I was trying to wrap my head on how to implement the OpCodes for the Forth CPU, and then I was daunted by the fact that you need to, some how compile the words with the outer interpreter to get to the codes words, is that all that isreally happening here?
What re the fundamental benefits vs just leveraging a lo cost *$0.50 µCU? Is it the word length? Specially since we are now seen cores running at 200MHz the size of the Attiny and they are 32 bits and also 400/600 Mhz RiscV systems the size of theSTM32F4 or smaller… >twice the RAM / FLASH…
I’m asking for my understanding, I’m enjoying learning something like Verilog, maybe even System Verilog… but I just don’t get the logic.
As to your Verilog, what are you trying to do with a line like,
temp[7:0] = 8'bzzzz_zzzz;
I'm curious as to what you think this assignment will do in hardware that results from this code.
in hardware.I'm asking an honest question. Verilog is an HDL, Hardware Description Language. It is used to "describe" hardware in terms of it's actions. What exactly do you think that assignment does in terms of an action. "assigning a temp space" has no meaningI'm curious as to what you think this assignment will do in hardware that results from this code.Not sure how to take your request, it’s just assigning a temp space for register temp… <Size>’<base><number>
I'm trying to understand how you are visualizing Verilog. I'm guessing that you don't actually have much understanding of the nature of the hardware produced.states possible in the default types have some states that are not actually realizable in hardware. They are mostly used to show results of poor logic design.
"Assigning a space" is something done in Verilog by declaring the signal, or whatever they call them in Verilog. I'm more conversant in VHDL which has signals and variables. Both can be thought of as "wires" with defined logic states. But most of the
Not try to be rude or anything. I'm just trying to figure out if I can help you in any way.
As to your Verilog, what are you trying to do with a line like,
temp[7:0] = 8'bzzzz_zzzz;
I'm curious as to what you think this assignment will do in hardware that results from this code.Not sure how to take your request, it’s just assigning a temp space for register temp… <Size>’<base><number>
in hardware.I'm asking an honest question. Verilog is an HDL, Hardware Description Language. It is used to "describe" hardware in terms of it's actions. What exactly do you think that assignment does in terms of an action. "assigning a temp space" has no meaningI'm curious as to what you think this assignment will do in hardware that results from this code.Not sure how to take your request, it’s just assigning a temp space for register temp… <Size>’<base><number>
states possible in the default types have some states that are not actually realizable in hardware. They are mostly used to show results of poor logic design.I'm trying to understand how you are visualizing Verilog. I'm guessing that you don't actually have much understanding of the nature of the hardware produced.
"Assigning a space" is something done in Verilog by declaring the signal, or whatever they call them in Verilog. I'm more conversant in VHDL which has signals and variables. Both can be thought of as "wires" with defined logic states. But most of the
Not try to be rude or anything. I'm just trying to figure out if I can help you in any way.Again, not sure how to take your request, I’m very conscious of overly apologetic conversations when I don’t see a reason for it, it raises a high level of suspicion on my end, so not really sure why you are apologizing?
As clearly stated… I’m learning Verilog, so I don’t have a deep understanding of the language nor do I claim to be a subject matter expert.
Please feel free to “show” me what the line does?
I’m always open to an opportunity to learn, hence my original questions.
In the mean time, I can share with you my understanding… "zzzz_zzzz" is a placeholder value that indicates an unknown or undefined state. It is often used in Verilog code as a default value for registers or other variables when their actual value isnot known or not relevant. In the code you provided, "zzzz_zzzz" is assigned to the "temp" register in several cases where the value of the "temp" register is not used or is not important.
Here, let me explain what i’m trying to do and by al means, show me a sample VHDL of how accomplish the following:and temp so z’ s, and if 010 again does nothing * has been set in first case, else if mode changes 011 and temp is set to z’s and if mode is 100, value reg is incremented to 1…. block waits for raising edge to execute each instruction…
I’m just building a simple program counter…. 3 bit mode, a clock, a pc_value and a temp value… If mode is 010 i assign the pc_value to the data bus, if the mode is 000 I value to 0’s set temp z’ s else if mode is 001 I set value to the bus
I’ve implemented this on a read board about 10 times playing with my kids… all it takes is a 555 and a 4027 (from memory).
Ok, so I’m learning Forth and Verilog…
i’m not proficient in neither, but I like to learn and hack stuff,
I built my first module on Verilog as a staring point for a Forth FPGA… https://gist.githubusercontent.com/jemo07/5d5ba7d31bb12410888f46ca6060a1f2/raw/1c597704a9a8f4f99b3e73a3906905ef0f38c358/ProgramCounter.v
Now, for Forth, how does that work out? If the outer interpreter is a JIT, it then compiles the words into core words *who are in term just Opcodes. In essence, is all we are saying that when you write native Forth, you are really writing complied code?
I ask this, as I was trying to wrap my head on how to implement the OpCodes for the Forth CPU, and then I was daunted by the fact that you need to, some how compile the words with the outer interpreter to get to the codes words, is that all that isreally happening here?
Ok, while I started this several weeks ago, I have a simple question… what do HW Forth implementations really do? I mean, I understand a picoJava, as it’s executing “bitecode,” and you remove the interpreter as the bite-codes[…]
map 1:1 to the Operating Instructions *Opcodes. The JIT in essence becomes the compiler and the code is run native.
code?Now, for Forth, how does that work out? If the outer interpreter is a JIT, it then compiles the words into core words *who are in term just Opcodes. In essence, is all we are saying that when you write native Forth, you are really writing complied
really happening here?I ask this, as I was trying to wrap my head on how to implement the OpCodes for the Forth CPU, and then I was daunted by the fact that you need to, some how compile the words with the outer interpreter to get to the codes words, is that all that is
You may want to study Brad Rodriguez' paper „Moving Forth” (5 parts): http://www.bradrodriguez.com/papers/moving1.htmThanks for the source, yes I agree that Brad’s book is great! it’s a fantastic way to learn how to write a forth.
So, the IP reg is used to save the IP when it is not being used, which makes it's logic fairly simple. Selecting what will be needed as the next address source is likely where the complexity will be.
The b16 Verilog source code is powerfully minimalist, perhaps it is time for this neat processor to get out and become more appreciated.
Jan Coombs
--
So, the IP reg is used to save the IP when it is not being used, which makes
it's logic fairly simple. Selecting what will be needed as the next address source is likely where the complexity will be.
The b16 Verilog source code is powerfully minimalist, perhaps it is time for
this neat processor to get out and become more appreciated.
Jan CoombsJan, that is fantastic feedback.
--
Jan, that is fantastic feedback.The Forth VM is unique to Forth. I don't recall any processor design that was literally a Forth VM, including the b16. They are stack machines, but often deviate from the Forth VM by adding various registers, and other details.
What exactly are you trying to do? What is your actual goal?
--
Rick C.
I wish I would have explore Forth rather than Java and we could have had FPGA 30 years ago and I was the the university… but why miss out on the fun of innovation…I am not sure anybody has answered your question directly.
Cheers,
Jose
I wish you success with your project and hope you publish your results.Thank you Brian! I appreciate the encouragement, and most of all, you provided some good feedback as to possible benefits.
On Wednesday, December 14, 2022 at 3:44:57 PM UTC-5, Brian Fox wrote:
In Forth on Hardware you will be compiling "native" opcodes for your CPU as primitives. Sub-routine calls will be used for hi-level words where you want to save space.
This most closely resembles "sub-routine threaded" Forth systems on conventional
machines. An optimizer could simply copy a sub-routine inline for a quick an
easy speed up.
" ...you build a Forth with the newly created opcode *yes they would match 1:1 to[
the 28 or so core words, but other than that, what are we gaining?"
Some Forth CPUs have taken advantage of the fact that <32 instructions can be the entire set for a Forth CPU, encoded in 5 bits. So in a 16 bit word you can
place 3 instructions in one word and execute them in parallel if possible, or take
at least take advantage of this to reduce memory fetches to read the program.
Some of Chuck Moore's machines used this approach as I recall.
Chuck reserved the last bit to make a sub-routine call and an implicit return.]
Clever.
I disagree on this point. Chuck's chips always had an explicit return aka ; instruction.
Only the called procedure can know when it is time to return.
I wish you success with your project and hope you publish your results.I as well.
In Forth on Hardware you will be compiling "native" opcodes for your CPU as primitives. Sub-routine calls will be used for hi-level words where you want to save space.[
This most closely resembles "sub-routine threaded" Forth systems on conventional
machines. An optimizer could simply copy a sub-routine inline for a quick an easy speed up.
" ...you build a Forth with the newly created opcode *yes they would match 1:1 to
the 28 or so core words, but other than that, what are we gaining?"
Some Forth CPUs have taken advantage of the fact that <32 instructions can
be the entire set for a Forth CPU, encoded in 5 bits. So in a 16 bit word you can
place 3 instructions in one word and execute them in parallel if possible, or take
at least take advantage of this to reduce memory fetches to read the program. Some of Chuck Moore's machines used this approach as I recall.
Chuck reserved the last bit to make a sub-routine call and an implicit return.]
Clever.
I wish you success with your project and hope you publish your results.
I don’t have goals, specifically, I’m just exploring the possibilities… I’m trying to learn a cool tech and fill the bunch of repurposed FPGA I got for $50
I wish I would have explore Forth rather than Java and we could have had FPGA 30 years ago and I was the the university… but why miss out on the fun of innovation…
simple. If you think about it, it is a perfect target for a massive parallelization, provided you can keep track of the order of the machine to keep track of next… *there is the idea of my temp ;^D but I have to admit, I did read Bob’s FunctionalJan, that is fantastic feedback.The Forth VM is unique to Forth. I don't recall any processor design that was literally a Forth VM, including the b16. They are stack machines, but often deviate from the Forth VM by adding various registers, and other details.
What exactly are you trying to do? What is your actual goal?
--
Rick C.Hello Ric, yes,, I have to agree, the Forth VM, ( not sure if *VM is an appropriate term ) behaves more like a intermediate state machine, there are some principals of a CPU there, but the level of abstraction that the stack machine provides is quite
I don’t have goals, specifically, I’m just exploring the possibilities… I’m trying to learn a cool tech and fill the bunch of repurposed FPGA I got for $50
I wish I would have explore Forth rather than Java and we could have had FPGA 30 years ago and I was the the university… but why miss out on the fun of innovation…
On Wednesday, December 14, 2022 at 12:32:15 PM UTC-5, SpainHackForth wrote:code?"
I wish I would have explore Forth rather than Java and we could have had FPGA 30 years ago and I was the the university… but why miss out on the fun of innovation…
Cheers,
JoseI am not sure anybody has answered your question directly.
Here is one from a hobby Forth guy.
"Now, for Forth, how does that work out? If the outer interpreter is a JIT, it then compiles the words into core words *who are in term just Opcodes. In essence, is all we are saying that when you write native Forth, you are really writing complied
So a traditional indirect-threaded Forth system compiles pointers to addresses and
although there is typically no "JIT" most implementers make some form of optimizer
in the course of their work. (peephole is popular) GForth, is unique, I think, in that
it tries to create optimized "super-instructions" to replace slower combinations of
Forth primitives.
In Forth on Hardware you will be compiling "native" opcodes for your CPU as primitives. Sub-routine calls will be used for hi-level words where you want to save space.
This most closely resembles "sub-routine threaded" Forth systems on conventional
machines. An optimizer could simply copy a sub-routine inline for a quick an easy speed up.
" ...you build a Forth with the newly created opcode *yes they would match 1:1 to
the 28 or so core words, but other than that, what are we gaining?"
Some Forth CPUs have taken advantage of the fact that <32 instructions can be the entire set for a Forth CPU, encoded in 5 bits. So in a 16 bit word you can
place 3 instructions in one word and execute them in parallel if possible, or take
at least take advantage of this to reduce memory fetches to read the program.
Some of Chuck Moore's machines used this approach as I recall.
Chuck reserved the last bit to make a sub-routine call and an implicit return.
Clever.
I wish you success with your project and hope you publish your results.
I bought the Pano Logic boards, a lot of them for $50, I got I think 30 the first lot, and 10 cisco cdma modems the second lot, so I’m about $150 in with all these boards including shipping to Spain… :DPS great analysis, Brian. Sorry this missed my first reply.I wish you success with your project and hope you publish your results.I as well.
I bought the Pano Logic boards, a lot of them for $50, I got I think 30 the first lot, and 10 cisco cdma modems the second lot, so I’m about $150 in with all these boards including shipping to Spain… :DPS great analysis, Brian. Sorry this missed my first reply.I wish you success with your project and hope you publish your results.I as well.
Here is a good resource I found after the fact, I bough these boards in 2018, so after Covid prices have changed, but you do get the Cisco board quite cheap if you search for them, if you get a lot like I did of used ones, they are very cheap indeed.
https://geeklan.co.uk/files/ossg16072020-repurposing_obsolete_fpga_and_dev_kits.pdf
Thanks for the link. But I'm still unclear on whether your boards are based on Spartan-3E (G1?) or Spartan-6 (G2?).
There are many options for instruction encoding. I designed an ISA that used a variable[..]
width instruction, allowing the remainder of the word to be immediate data.
Multiple literal instructions would shift left the previous top of return stack and shift in[..]
another n-1 bits. This could be repeated ad nauseam to fill any size data word desired.
The last design I was working on was a stack design that allowed offset addressing
as part of the instruction. This greatly reduced the need for stack juggling instructions,
like DUP, SWAP, ROT, etc.
Thanks for the link. But I'm still unclear on whether your boards are based on Spartan-3E (G1?) or Spartan-6 (G2?).I got the G2 so they are Spartan 6.
On Thursday, December 15, 2022 at 9:34:32 AM UTC+1, gnuarm.del...@gmail.com wrote:
[..]
There are many options for instruction encoding. I designed an ISA that used a variable[..]
width instruction, allowing the remainder of the word to be immediate data.
Multiple literal instructions would shift left the previous top of return stack and shift in[..]
another n-1 bits. This could be repeated ad nauseam to fill any size data word desired.
The last design I was working on was a stack design that allowed offset addressingSo you reinvented the INMOS transputer?
as part of the instruction. This greatly reduced the need for stack juggling instructions,
like DUP, SWAP, ROT, etc.
On Thursday, December 15, 2022 at 9:54:15 AM UTC-5, Marcel Hendrix wrote:mostly addresses. I don't actually remember so much else about Transputer architecture. Did they only have a stack, or did they use registers? The TI 9900 processor family had registers in memory, so you could change the workspace pointer by the size of
On Thursday, December 15, 2022 at 9:34:32 AM UTC+1, gnuarm.del...@gmail.com wrote:That's what you think the Transputer is? One thing they did I never liked, was the opcodes were four bits. So you got a four bit opcode to provide a 4 bit immediate data nibble. Not so efficient. In Forth, much of the operations involve immediate data,
[..]
There are many options for instruction encoding. I designed an ISA that used a variable[..]
width instruction, allowing the remainder of the word to be immediate data.
Multiple literal instructions would shift left the previous top of return stack and shift in[..]
another n-1 bits. This could be repeated ad nauseam to fill any size data word desired.
The last design I was working on was a stack design that allowed offset addressingSo you reinvented the INMOS transputer?
as part of the instruction. This greatly reduced the need for stack juggling instructions,
like DUP, SWAP, ROT, etc.
I did some programming with Transputers in the 80s, I think. They were used on a significant system for the government. The project made things very complex though. Data was all time stamped rather than setting up known delay paths so the data would becorrelated by design, rather than having to look at time stamps and realigning. I guess they didn't trust their ability to maintain constant delay paths.
On Wednesday, December 14, 2022 at 11:50:27 PM UTC-5, Myron Plichota wrote:
I didn't have it quite right Myron, but I knew there was something in RTX2000[
Chuck reserved the last bit to make a sub-routine call and an implicit return.]
Clever.
I disagree on this point. Chuck's chips always had an explicit return aka ; instruction.
Only the called procedure can know when it is time to return.
regarding free sub-routine returns.
It was only 30 something years ago. :-)
From Koopman, Stack Computers
---------------------------
Figure 4.9(c) -- RTX instruction formats -- ALU operation.
Figure 4.9c shows the format of the ALU instruction. Bits 0-3 control the operation
of the shifter that shifts the output of the ALU.
Bit 5 of the ALU instruction indicates a subroutine return operation. This allows
subroutine returns to be combined with preceding arithmetic operations to obtain
"free" subroutine returns in many cases.
[
Chuck reserved the last bit to make a sub-routine call and an implicit return.]
Clever.
I disagree on this point. Chuck's chips always had an explicit return aka ; instruction.
Only the called procedure can know when it is time to return.
On Thursday, December 15, 2022 at 9:54:15 AM UTC-5, Marcel Hendrix wrote:
On Thursday, December 15, 2022 at 9:34:32 AM UTC+1,gnuarm.del...@gmail.com wrote:
[..]that used a variable
There are many options for instruction encoding. I designed an ISA
return stack and shift inwidth instruction, allowing the remainder of the word to be immediate data.[..]
Multiple literal instructions would shift left the previous top of
data word desired.another n-1 bits. This could be repeated ad nauseam to fill any size
[..]offset addressing
The last design I was working on was a stack design that allowed
as part of the instruction. This greatly reduced the need for stack >juggling instructions,So you reinvented the INMOS transputer?
like DUP, SWAP, ROT, etc.
That's what you think the Transputer is? One thing they did I never
liked, was the opcodes were four bits. So you got a four bit opcode to >provide a 4 bit immediate data nibble. Not so efficient. In Forth,
--
Rick C.
In article <fba10216-4153-4dd6...@googlegroups.com>,
Lorem Ipsum <gnuarm.del...@gmail.com> wrote:
On Thursday, December 15, 2022 at 9:54:15 AM UTC-5, Marcel Hendrix wrote: >> On Thursday, December 15, 2022 at 9:34:32 AM UTC+1, >gnuarm.del...@gmail.com wrote:
[..]
There are many options for instruction encoding. I designed an ISA >that used a variable[..]
width instruction, allowing the remainder of the word to be immediate data.
Multiple literal instructions would shift left the previous top of >return stack and shift in[..]
another n-1 bits. This could be repeated ad nauseam to fill any size >data word desired.
The last design I was working on was a stack design that allowed >offset addressingSo you reinvented the INMOS transputer?
as part of the instruction. This greatly reduced the need for stack >juggling instructions,
like DUP, SWAP, ROT, etc.
That's what you think the Transputer is? One thing they did I neverYou realize that Marcel Hendrix is one of the top ten in depth
transputer experts of the planet?
(Before the transputer boards arrived he had programmed an emulator
to test the transputer Forth)
liked, was the opcodes were four bits. So you got a four bit opcode to >provide a 4 bit immediate data nibble. Not so efficient. In Forth,You remember incorrectly. This was crazy efficient. With the implicit
three deep stack you could program the hail stone sequence
'2 / 3 +' using implicit register (tos) addressing.
4 bits opcode, 4 bits immediate , two times makes 16 bit.
(on a 32 bit processor).
On Wednesday, December 14, 2022 at 11:50:27 PM UTC-5, Myron Plichota wrote:
I didn't have it quite right Myron, but I knew there was something in RTX2000 regarding free sub-routine returns.[
Chuck reserved the last bit to make a sub-routine call and an implicit return.]
Clever.
I disagree on this point. Chuck's chips always had an explicit return aka ; instruction.
Only the called procedure can know when it is time to return.
It was only 30 something years ago. :-)
From Koopman, Stack Computers
---------------------------
Figure 4.9(c) -- RTX instruction formats -- ALU operation.
Figure 4.9c shows the format of the ALU instruction. Bits 0-3 control the operation
of the shifter that shifts the output of the ALU.
Bit 5 of the ALU instruction indicates a subroutine return operation. This allows
subroutine returns to be combined with preceding arithmetic operations to obtain
"free" subroutine returns in many cases.
--------------------------
This would be an excellent reference for Jose as well. https://users.ece.cmu.edu/~koopman/stack_computers/index.html
Hum interesting.. :D thanks for sharing..https://users.ece.cmu.edu/~koopman/stack_computers/index.htmlNow I understand the RTX2000 context. Thanks. https://users.ece.cmu.edu/~koopman/stack_computers/sec4_5.html
Ok, so I’m learning Forth and Verilog… i’m not proficient in neither, but I like to learn and hack stuff, I built my first module on Verilog as a staring point for a Forth FPGA… https://gist.githubusercontent.com/jemo07/5d5ba7d31bb12410888f46ca6060a1f2/raw/1c597704a9a8f4f99b3e73a3906905ef0f38c358/ProgramCounter.v
This is my cheesy Program counter, I know, don’t laugh… :D.[snip]
I’m asking for my understanding, I’m enjoying learning something like Verilog, maybe even System Verilog… but I just don’t get the logic.
On Tuesday, December 13, 2022 at 1:31:52 PM UTC-5, SpainHackForth wrote:5d5ba7d31bb12410888f46ca6060a1f2/raw/1c597704a9a8f4f99b3e73a3906905ef0f38c358/ProgramCounter.v
Ok, so I’m learning Forth and Verilog… i’m not proficient in neither, but I like to learn and hack stuff, I built my first module on Verilog as a staring point for a Forth FPGA… https://gist.githubusercontent.com/jemo07/
This is my cheesy Program counter, I know, don’t laugh… :D.[snip]
I’m asking for my understanding, I’m enjoying learning something like Verilog, maybe even System Verilog… but I just don’t get the logic.
Blessed are the humble in spirit. After pondering ProgramCounter.v, my 2 cents:
1) inout [7:0] data_bus; (and z values)
The inout module port attribute must be reserved for the top-level SoC FPGA pins.
On-chip FPGA routing fabric does not provide bidirectional wires that can be driven by multiple sources, and the jellybean concept of connecting tristate microprocessor, RAM, ROM, and IO through copper no longer works.
Instead, definite inputs, outputs, and muxs are used to work under the hood, knowing only unidirectional 1s and 0s.
2) Within an always @(posedge clock) clause, the "<=" assignment (not "=") must be used for meaningful results.
3) A global reset is normally present on any SoC, and you may wish to take advantage of that.
On Saturday, December 17, 2022 at 3:55:23 AM UTC-5, Myron Plichota wrote:5d5ba7d31bb12410888f46ca6060a1f2/raw/1c597704a9a8f4f99b3e73a3906905ef0f38c358/ProgramCounter.v
On Tuesday, December 13, 2022 at 1:31:52 PM UTC-5, SpainHackForth wrote:
Ok, so I’m learning Forth and Verilog… i’m not proficient in neither, but I like to learn and hack stuff, I built my first module on Verilog as a staring point for a Forth FPGA… https://gist.githubusercontent.com/jemo07/
This is my cheesy Program counter, I know, don’t laugh… :D.[snip]
I’m asking for my understanding, I’m enjoying learning something like Verilog, maybe even System Verilog… but I just don’t get the logic.
Blessed are the humble in spirit. After pondering ProgramCounter.v, my 2 cents:
1) inout [7:0] data_bus; (and z values)
The inout module port attribute must be reserved for the top-level SoC FPGA pins.
On-chip FPGA routing fabric does not provide bidirectional wires that can be driven by multiple sources, and the jellybean concept of connecting tristate microprocessor, RAM, ROM, and IO through copper no longer works.
Instead, definite inputs, outputs, and muxs are used to work under the hood, knowing only unidirectional 1s and 0s.
2) Within an always @(posedge clock) clause, the "<=" assignment (not "=") must be used for meaningful results.This is not true. Both assignments have a purpose, you simply need to understand how they work.
In VHDL the assignments are := and <=. := is used with variables to update a variable immediately in a process (or procedure), which is much more like the way software works. It is used to describe logic within the process.
<= establishes a value to be assigned, but does not perform the assignment until the process exits. This is typically used for register assignments.
resulting in the device starting in random states. There are techniques to mitigate this problem.3) A global reset is normally present on any SoC, and you may wish to take advantage of that.Global resets must be used with caution. The difficulty is exiting the reset condition. The reset signal is asynchronous to the clock, plus has long routing times. This makes it hard for every part of the design to exit reset at the same time,
On Saturday, December 17, 2022 at 11:34:42 AM UTC-5, gnuarm.del...@gmail.com wrote:5d5ba7d31bb12410888f46ca6060a1f2/raw/1c597704a9a8f4f99b3e73a3906905ef0f38c358/ProgramCounter.v
On Saturday, December 17, 2022 at 3:55:23 AM UTC-5, Myron Plichota wrote:
On Tuesday, December 13, 2022 at 1:31:52 PM UTC-5, SpainHackForth wrote:
Ok, so I’m learning Forth and Verilog… i’m not proficient in neither, but I like to learn and hack stuff, I built my first module on Verilog as a staring point for a Forth FPGA… https://gist.githubusercontent.com/jemo07/
resulting in the device starting in random states. There are techniques to mitigate this problem.This is my cheesy Program counter, I know, don’t laugh… :D.[snip]
I’m asking for my understanding, I’m enjoying learning something like Verilog, maybe even System Verilog… but I just don’t get the logic.
Blessed are the humble in spirit. After pondering ProgramCounter.v, my 2 cents:
1) inout [7:0] data_bus; (and z values)
The inout module port attribute must be reserved for the top-level SoC FPGA pins.
On-chip FPGA routing fabric does not provide bidirectional wires that can be driven by multiple sources, and the jellybean concept of connecting tristate microprocessor, RAM, ROM, and IO through copper no longer works.
Instead, definite inputs, outputs, and muxs are used to work under the hood, knowing only unidirectional 1s and 0s.
2) Within an always @(posedge clock) clause, the "<=" assignment (not "=") must be used for meaningful results.This is not true. Both assignments have a purpose, you simply need to understand how they work.
In VHDL the assignments are := and <=. := is used with variables to update a variable immediately in a process (or procedure), which is much more like the way software works. It is used to describe logic within the process.
<= establishes a value to be assigned, but does not perform the assignment until the process exits. This is typically used for register assignments.Jose's First Verilog Project (a program counter driven by a clock rising edge, i.e. a "smart" register) has no need for advanced topics. I remember being a Verilog newbie, and the KISS principle.
Whipping out VHDL (not Verilog) syntax contributes nothing to a Verilog newbie's success.
3) A global reset is normally present on any SoC, and you may wish to take advantage of that.Global resets must be used with caution. The difficulty is exiting the reset condition. The reset signal is asynchronous to the clock, plus has long routing times. This makes it hard for every part of the design to exit reset at the same time,
Indeed there are. e.g:
1) do not use async resets, even if the FPGA fabric offers the option, eliminating said problem
2) instead, write modules to test reset as the first decision within an always @(posedge clock) clause
3) prevent metastability by resampling the external reset pin through 2 simple D registers
Indeed there are. e.g:If people are interested in a start with Verilog / VHDL,
1) do not use async resets, even if the FPGA fabric offers the option, eliminating said problem
2) instead, write modules to test reset as the first decision within an always @(posedge clock) clause
3) prevent metastability by resampling the external reset pin through 2 simple D registers
this link might be a good starting point with many examples
including the NANDLAND board to run the code.
I had suggested to him already to adapt his examples to the standard Lattice boards,
where people could add this special hardware themselves.
this would increase the amount of users a lot probably https://nandland.com/learn-verilog/
On Saturday, December 17, 2022 at 11:34:42 AM UTC-5, gnuarm.del...@gmail.com wrote:5d5ba7d31bb12410888f46ca6060a1f2/raw/1c597704a9a8f4f99b3e73a3906905ef0f38c358/ProgramCounter.v
On Saturday, December 17, 2022 at 3:55:23 AM UTC-5, Myron Plichota wrote:
On Tuesday, December 13, 2022 at 1:31:52 PM UTC-5, SpainHackForth wrote:
Ok, so I’m learning Forth and Verilog… i’m not proficient in neither, but I like to learn and hack stuff, I built my first module on Verilog as a staring point for a Forth FPGA… https://gist.githubusercontent.com/jemo07/
This is my cheesy Program counter, I know, don’t laugh… :D.[snip]
I’m asking for my understanding, I’m enjoying learning something like Verilog, maybe even System Verilog… but I just don’t get the logic.
Blessed are the humble in spirit. After pondering ProgramCounter.v, my 2 cents:
1) inout [7:0] data_bus; (and z values)
The inout module port attribute must be reserved for the top-level SoC FPGA pins.
On-chip FPGA routing fabric does not provide bidirectional wires that can be driven by multiple sources, and the jellybean concept of connecting tristate microprocessor, RAM, ROM, and IO through copper no longer works.
Instead, definite inputs, outputs, and muxs are used to work under the hood, knowing only unidirectional 1s and 0s.
2) Within an always @(posedge clock) clause, the "<=" assignment (not "=") must be used for meaningful results.This is not true. Both assignments have a purpose, you simply need to understand how they work.
In VHDL the assignments are := and <=. := is used with variables to update a variable immediately in a process (or procedure), which is much more like the way software works. It is used to describe logic within the process.
<= establishes a value to be assigned, but does not perform the assignment until the process exits. This is typically used for register assignments.Jose's First Verilog Project (a program counter driven by a clock rising edge, i.e. a "smart" register) has no need for advanced topics. I remember being a Verilog newbie, and the KISS principle.
Whipping out VHDL (not Verilog) syntax contributes nothing to a Verilog newbie's success.
resulting in the device starting in random states. There are techniques to mitigate this problem.3) A global reset is normally present on any SoC, and you may wish to take advantage of that.Global resets must be used with caution. The difficulty is exiting the reset condition. The reset signal is asynchronous to the clock, plus has long routing times. This makes it hard for every part of the design to exit reset at the same time,
Indeed there are. e.g:
1) do not use async resets, even if the FPGA fabric offers the option, eliminating said problem
2) instead, write modules to test reset as the first decision within an always @(posedge clock) clause
3) prevent metastability by resampling the external reset pin through 2 simple D registers
starting in random states. There are techniques to mitigate this problem.
Thank you all for the comments and encouragement, I made a slight modification: https://gist.githubusercontent.com/jemo07/4f039197b1174c99962732bf3e5dc93b/raw/2f98c30501c4d108e4a2a8a6c38bf57011b5107c/ProgramCounter-sysver.vIndeed there are. e.g:If people are interested in a start with Verilog / VHDL,
1) do not use async resets, even if the FPGA fabric offers the option, eliminating said problem
2) instead, write modules to test reset as the first decision within an always @(posedge clock) clause
3) prevent metastability by resampling the external reset pin through 2 simple D registers
this link might be a good starting point with many examples
including the NANDLAND board to run the code.
I had suggested to him already to adapt his examples to the standard Lattice boards,
where people could add this special hardware themselves.
this would increase the amount of users a lot probably https://nandland.com/learn-verilog/
Here is a little progress… https://gist.githubusercontent.com/jemo07/f7dd6ee69bda88f430453cedc5fe6b74/raw/635a09db45aff8d7cb6c33bd91a6152ea7284fcb/ControlUnit_sysver.v
I’m not sure if this will all work, but I’m sure learning a ton about the HW and mostly about Forth!
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 35:44:04 |
Calls: | 6,707 |
Files: | 12,239 |
Messages: | 5,353,388 |