verilog code for microprocessor

Thread Starter

shin

Joined Oct 16, 2006
16
How to write verilog code for a simple microprocessor? For example, the microprocessor will be able to perform some of instructions like load, move, add immediate or add with other register. How to write them in verilog code? Actually this is my first time in microprocessor design and i am very new in verilog code. One more thing, i was given the mnemonics for the instructions above.

load - MOV A, 40H
move data from one register to another register - MOV B,A
add immediate - ADD 45H
add with other register - ADD B
 

beenthere

Joined Apr 20, 2004
15,819
What you are describing is machine level instructions that actually execute in the microprocessor. An assembler for the microprocessor will let you write this code.

Verilog is a language that lets you do simulations of devices external to the microprocessor. Verilog will not act as an assembler for you microprocessor.
 

Papabravo

Joined Feb 24, 2006
13,503
I did not see it at first but I beleive there is ambiguity in the original question.

Shin:

Do you want to
  1. Write an assembly language program for the processor to execute?
  2. Write a verilog description of a generic processor to execute simple instructions?
I believe your original post was asking for alternative 2., while beenthere believes it was asking for alternative 1.
It is interesting to note that you have given 8051 instuctions as examples.

You must take great care to phrase your request in unamiguous terms so as to maximize the probability of getting a useful response.
 

Thread Starter

shin

Joined Oct 16, 2006
16
thank you for the replies and sorry for the inconvenient,

i think my question is no 2 from the papabravo choices. Do you have any examples of a verilog description of a generic processor to execute simple instructions. Actually i don't know where should i start from.
 

Papabravo

Joined Feb 24, 2006
13,503
Learning a language like verilog comes in two parts. First you must learn the syntax or form of a verilog program so that you can write a program which follows the structural rules of the language. Second you must learn the semantics or the meaning of the expressions, statements and programs. You should use google to search for "verilog examples" or "tutorials"

I'm sorry I can't help you on this one since I was never in the ASIC business.
 
Top