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...

Functions And Tasks In Verilog

 Hello Dear Readers,

Today, I will explain how functions and tasks are used in Verilog to make our lengthy code highly optimized.

Task and functions are used in the Verilog to describe the commonly used functional behavior. Instead of replicating the same code at different places, it is good and common practice to use the functions or tasks depending on the requirement. For easy maintenance of the code, it is better to use the functions or tasks like the subroutine. Let's see the example below for a better understanding.

1). Counting 1’s from the Given String Using Functions:

The following are the key important points that need to remember while using the function: 

1. Function can not consists of the time control statements and even delay operators.

2. Function can have at least one input argument declaration. 

3. Function can consist of function calls but function cannot consist of the task. 

4. Function executes in zero simulation time and returns a single value when called. 

5. It is not recommended to use the function while writing the synthesizable Verilog RTL. 

6. Functions are used for writing the behavioral or simulatable model. 

7. Functions should not have nonblocking assignments.

In this example, the function is used with the argument ‘‘data_in’’. The name of the function is ‘‘count_1s_in_byte’’. In most of the protocol descriptions, it is required to perform some operations on the input string. In this example, the string is an 8-bit input ‘‘data_in’’ and output result is 4-bit ‘‘out’’. Here code is parameterized so we can extend it to any number of bits of string. It is not recommended to use the function to generate synthesized logic.

Verilog Code:

module count_one #(parameter N=8)(data_in,out);

input [N-1:0] data_in;

output reg [N-5:0] out;

always @(data_in)

out=count_1s_in_string(data_in);


function [N-5:0] count_1s_in_string;

  input [N-1:0] data_in;

  integer i;

begin  

  count_1s_in_string=0;

 for(i=0;i<N;i=i+1)

  if(data_in[i]==1) count_1s_in_string=count_1s_in_string+1;

end

endfunction  

endmodule

2). Counting 1’s from the Given String Using Tasks:
The following are key important points that need to remember while using the task: 
1. Task can consist of the time control statements and even delay operators. 

2. Task can have input and output declarations. 

3. Task can consist of function calls but function cannot consist of the task. 

4. Task can have output argument and not be used to return the value when called. 

5. Task can be used to call other tasks. 

6. It is not recommended to use the task while writing the synthesizable Verilog RTL. 

7. Tasks are used for writing the behavioral or simulatable model.

Verilog Code:

module count_one #(parameter N=8)(data_in,out);

input [N-1:0] data_in;

output reg [N-5:0] out;

always @(data_in)

count_1s_in_string(data_in,out);


task count_1s_in_string;

  input [N-1:0] data_in;

  output reg [N-5:0] out;

  integer i;

begin  

  out=0;

 for(i=0;i<N;i=i+1)

  if(data_in[i]==1) out=out+1;

end

endtask  

endmodule

Simulational Results:





Comments

  1. Easy explanation

    ReplyDelete
  2. Your site is last end point of our search. Keep it up

    ReplyDelete

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...