Skip to main content

Silicon Engineering Intern at Microsoft India

  Hello Dear Readers, Currently, at Microsoft India  vacancy for Silicon Engineering Intern role. At Microsoft, Interns work on real-world projects in collaboration with teams across the world, while having fun along the way. You’ll be empowered to build community, explore your passions and achieve your goals. This is your chance to bring your solutions and ideas to life while working on cutting-edge technology. Microsoft’s mission is to empower every person and every organization on the planet to achieve more. As employees we come together with a growth mindset, innovate to empower others, and collaborate to realize our shared goals. Each day we build on our values of respect, integrity, and accountability to create a culture of inclusion where everyone can thrive at work and beyond. Qualifications: Currently pursuing a bachelor’s degree in Electronics Engineering, Electrical & Electronics/Computer Science Engineering.   Preferred Qualifications (PQs):   Experience or classes in t

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_nets] setting maximum capacitance of 700fF on all nets. similarly, set_max

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

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 equivalent degree