Skip to main content

Product Engineer II at Cadence Design Systems

Hello Dear Readers, Cadence Design Systems has a vacancy for a Product Engineer II role. Cadence is a pivotal leader in electronic design, building upon more than 30 years of computational software expertise. The company applies its underlying Intelligent System Design strategy to deliver software, hardware and IP that turn design concepts into reality.  Cadence customers are the world’s most innovative companies, delivering extraordinary electronic products from chips to boards to systems for the most dynamic market applications including consumer, hyperscale computing, 5G communications, automotive, aerospace industrial and health. The Cadence Advantage: The opportunity to work on cutting-edge technology in an environment that encourages you to be creative, innovative, and to make an impact. Cadence’s employee-friendly policies focus on the physical and mental well-being of employees, career development, providing opportunities for learning, and celebrating success in recog...

Design of the Single Cycle Microprocessor Using Verilog HDL

Hello Dear Readers,

Here I have uploaded my designed single cycle 8-bit CISC microprocessor using Verilog HDL. So Let's see and try your own as per your specification.
 
First of all, as we know CISC microprocessor has separate instruction memory and data memory so here I have make two text file for that and then designed one by one block of the microprocessor such as clock generation, ALU(Arithmetic Logical Unit), File reading as well as writing back, ...etc.

Verilog Code:

module microprocessor1();
reg reset;
reg clock;
reg [7:0] Dmem[0:255];// data memory array for the data file stored
reg [31:0] Imem[0:255];// instruction memory array for the instruction stored
reg [7:0] pc; // 8-bit program counter
reg [31:0] instruction; // 32-bit Instruction Register
reg [7:0] opcode; // 8-bit opcode
reg [7:0] destAddr; // 8-bit Destination Address
reg [7:0] src1Addr; // 8-bit Source Address #1
reg [7:0] src2Addr; // 8-bit Source Address #2
reg [7:0] src1Data; // 8-bit Source Data #1
reg [7:0] src2Data; // 8-bit Source Data #2
reg [7:0] Result; // 8-bit Result Data
reg [7:0] braAddr; // 8-bit Relative Branch address
integer outfile1;
integer i;

// define mnemonics of the designed microprocessor
//`define ADD 8'b00000000
//`define SUB 8'b00000001
//`define MUL 8'b00000010
//`define DIV 8'b00000011
//`define BRA 8'b00000100

integer clock_period=50;
/****************************************************************************
clcok generation block
*****************************************************************************/
initial 
begin 
 clock=1'b0;
 reset=1'b0;
 end 
always
#(clock_period/2)  clock=~clock;
always
#10000 reset=~reset;


/*******************************************************************************
Designing of the Microprocessor Model
*******************************************************************************/
always @(posedge clock or posedge reset) begin
if(reset)
begin // Reset Sequence is genereted here for disable opreration aswell as reset program counter
disable fetch_and_execute;
pc=0;
end
else begin : fetch_and_execute // Fetch and execute instructions
instruction=Imem[pc];
// we divided the instruction register for the performing operation according to the instruction which is given
opcode=instruction[31:24]; // Get Opcode
destAddr=instruction[23:16]; // Get Destination Data Address
src1Addr=instruction[15:8]; // Get Source Data Address #1
src2Addr=instruction[7:0]; // Get Source Data Address #2
braAddr=instruction[23:16]; // Get relative address for BRA instruction
case(opcode)
//`ADD:
8'b00000000:
begin
$display("ADD INSTRUCTION:");
src1Data=Dmem[src1Addr]; // Get Data Operands
src2Data=Dmem[src2Addr];
Result=src1Data+src2Data; // Calculate Result
Dmem[destAddr]=Result; // Write Result data
#(clock_period) pc=pc+1; // ADD instruction takes one clock cycle
end
//`SUB:
8'b00000001:
begin
$display("SUB INSTRUCTION:");
src1Data=Dmem[src1Addr]; // Get Data Operands
src2Data=Dmem[src2Addr];
Result=src1Data-src2Data; // Calculate Result
Dmem[destAddr]=Result; // Write Result data
#(clock_period) pc=pc+1; // SUB instruction takes one clock cycle
end
//`MUL:
8'b00000010:
begin
$display("MUL INSTRUCTION:");
src1Data=Dmem[src1Addr]; // Get Data Operands
src2Data=Dmem [src2Addr];
Result=src1Data*src2Data; // Calculate Result
Dmem[destAddr]=Result; // Write Result Data
// MUL instruction takes three clock cycles
#(3*clock_period) pc=pc+1;
end
//DIV:
8'b00000011:
begin
$display("DIV INSTRUCTION:");
src1Data=Dmem[src1Addr];
src2Data=Dmem[src2Addr];
Result=src1Data/src2Data;
Dmem[destAddr]=Result;
// DIV instruction takes three clock cycles
#(3*clock_period) pc=pc+1; // increment program counter
end
//`BRA:
8'b00000100:
begin
$display("BRA INSTRUCTION:");
 // BRA instruction takes two clock cycles
#(2*clock_period) pc=pc+braAddr; // calculate new program counter
end
endcase
end
end
/****************************************************************************
Display the updation of the status of the microprocessor
****************************************************************************/
initial
begin
// Display a header for the test Output
$display("\t PROG DEST SRC1 SRC2 SRC1 SRC2 RESULT");
$display("\t TIME RESET CNTR OPCODE ADDR ADDR ADDR DATA DATA DATA");
$display("\t---- ---- ---- ------ ---- ---- ---- ---- ------\n");
// Display Results at every clock edge
forever @(posedge clock)
$display ("\t %0d \t %b %h %h %h %h %h %h %h %h",
$time,reset,pc,opcode,destAddr,src1Addr,src2Addr,src1Data,src2Data, Result);
end
/******************************************************************************
Initialized and the sun after writing the assembly level data and the instruction text file
******************************************************************************/
initial
begin
$readmemh("instruction.txt",Imem); // Initialize instruction memory
$readmemh("data.txt",Dmem); // Initialize data memory
#(256*clock_period);
outfile1=$fopen("data.txt","w");
 for (i = 0; i<256; i=i+1) begin
   $fwrite(outfile1,"%d\n",Dmem[i]);  //write as decimal in the data memory file after performed operation as per code
 end 
$fclose(outfile1);
end
endmodule 

Simulational Results:

Here I wrote instruction hex code in the text file that will be fetching and decoding and corresponding data will be taken from the data memory and store back the results. 


 

Comments

  1. Thank you sir and expecting more well����������������

    ReplyDelete
    Replies
    1. Thanks and yes I will try to updating more and more advanced this site

      Delete
  2. Good starting bro and we will waiting more and more keep it up

    ReplyDelete
  3. This platform definitely will be ideal place for VLSI learner!!!!!!!!!!!!!!!!!

    ReplyDelete
    Replies
    1. yes Sir/Madam i will try to make it definitely and thanks for supporting

      Delete
  4. Great post Nishit I am radhu your internship friend. Keep it up !!!!!!

    ReplyDelete
    Replies
    1. Yaah radhu thanks for reading and try to contact me on nishitnathwani97@gmail.com

      Delete

Post a Comment

Popular posts from this blog

SDC (Synopsys Design Constraints) contents part 4

Today, we will be discussing the remaining constraints mentioned in the SDC, which pertain to timing exceptions and design rules. This is the final part of the SDC contents. This is going to be interesting, especially with multicycle paths. Take time to read and try to comprehend. 10. set_max_transition     By setting max transition value, our design checks that all ports and pins are meeting the specified limits mentioned in SDC. If these are not satisfied then timing report will give DRVs (design rule violations) in terms of slack. This is specified as               set_max_transition 0.5  UBUF1/A setting maximum limit of 500ps on pin A of Buffer1. 11. set_max_capacitance     This is same as max transition, setting the maximum capacitance value. if our design not meeting this value then violation will occur. This will also reports under design rule violations in terms of slack.     set_max_capacitance 0.7 [all_...

Apprenticeship CAI at MediaTek Bangalore

Hello Dear Readers,   Currently at MediaTek Bangalore vacancy for an Apprenticeship CAI role. Job Description: B.Tech degree in Electrical/Electronics Engineering with a strong educational background in Digital circuit design Experience in physical design of high performance design with frequencies > 2 Ghz. Experienced in hierarchical design, budgeting, multiple voltage domains and multiple clock domains. Strong skills with Cadence Encounter. Solid understanding of STA and timing constraints. Experienced in working on advanced process nodes (16nm). Strong expertise in Physical Verification to debug LVS/DRC issues at the block level. Requirement: B.Tech degree in Electrical/Electronics Engineering with strong educational background in Digital circuit design Experience in physical design of high performance design with frequencies > 2 Ghz. Experienced in hierarchical design, budgeting, multiple voltage domains and multiple clock domains. Strong skills with Cadence Enc...

IC Physical Design (PnR) at Ulkasemi

Hello Dear Readers,   Ulkasemi  has a vacancy for an IC Physical Design (PnR) role. Job Overview: As a full-time Trainee Engineer, the individual will be working on IC Physical Design implementation from RTL to GDSII to create design databases ready for manufacturing with a special focus on power, performance & area optimization with next-generation state-of-the-art process technologies. Job Responsibilities: Perform physical design implementation which includes Floor planning, Power Planning, Clock Tree Synthesis, Place and Route, ECO, Logic Equivalence checks Timing analysis, physical & electrical verification, driving the sign-off closure meeting schedule, and design goals Develop flow, methodologies, and automation scripts for various implementation steps Follow the instructions, compile documents, prepare deliverables, and report to the team lead Should remain up to date with the latest technology trends Educational Qualification:   B.Sc/M.Sc   in EEE or...