Hi All,
When my blogspot loads, I see the bottom bar saying connecting to js.jargonfish.com. It had been going a little while. I did add some gadgets recently and that causes the issue. So I edited the HTML and removed that piece of code and it works fine for me.
Please let me know if you see any issues.
Thanks,
Suresh
Thursday, February 10, 2011
Resolved the issue....
I am back after 2 years!!!
Hi All,
I've been out for almost 2 years because of work pressure and some other issues. I haven't even checked my blogspot for long time. I noticed that it is taking more than 5 minutes to load the web page.
Does anyone know the reason for that? I would appreciate if you guys give me your opinions.
I thank you all for visiting my blogspot and I am sure that I'll keep on updating the blogspot.
Thanks,
Suresh
Monday, September 29, 2008
Writing test cases using sequences
extend MAIN usb_sequence_s {
body()@driver.clock is only {
do usb_transaction_s keeping {
.pid == SETUP};
}; // End of do
}; // End of body()
}; // End of MAIN
To create a simple test based on the sequence library is to choose a subset that will be activated in the specific test and then set the weights for each kind using keep soft select.
Tuesday, September 23, 2008
Sequence Implementation
- The items and sub-sequences are created inside the pre-defined TCM called "body()" - used to define the behavior of the sequences - using the dedicated "do" action.
- The body() TCM inside the MAIN sequence is launched automatically by the run() method inside the sequence driver.
- The body() TCM of any sub-sequence is activated by the "do" action.
- The body() TCM defines the duration of the sequences.
- When "do"ing an item, you must emit the event driver.item_done to let the sequence complete the "do" action and inform the driver that the item was processed. Without emitting this event, the sequence cannot continue, and the driver cannot drive more items.
- The do action can only be activated inside sequences.
Once you define the sequence struct, you can create various scnearios by creating the sub types of the sequences using kind field.
1. Extend the sequence kind type with the new kind
extend usb_transaction_kind_t : [ SETUP];
2. Extend the new sequence sub type of the kind with either parameters or body().
// SETUP Transaction
extend SETUP usb_sequence_s {
body()@driver.clock is {
do sequence_items keeping {
// completed once the driver. packet_done is emitted. Hence the "do sequence_items" and
// driver.get_next_item work in tandem
}; // End of body()
}; // End of extend
// OUT Transaction
extend usb_transaction_kind_t : [ OUT];
extend OUT usb_sequence_s {
body()@driver.clock is {
do sequence_items keeping {
.pid == OUT;
}; // End of body()
}; // End of extend
// IN Transaction
extend usb_transaction_kind_t : [ IN];
extend IN usb_sequence_s {
body()@driver.clock is {
do sequence_items keeping {
.pid == IN;
}; // End of body()
}; // End of extend
In the next post, we will see how to write the test cases using sequences.
Monday, September 22, 2008
Sequences in Specman
Introduction: Sequences let you define the streams of data items sent over to the input protocol of the DUT. Before moving on to the details of sequences, let me give you some of the important definitions.
Item : It is a struct that represents the main inputs to the DUT - Basically a USB packet or an CPU instruction.
Sequence : It is a struct that represents the streams of data items generated one after another according to some protocol, say for example, in USB - Out or setup packet is transferred followed by Data packet.
Basically a TCM which resides in the BFM does the actual transmission of data items. Both the sequence driver and BFM acts as a pair; The sequence driver serves as the interface upward towards the sequnces and the BFM serves as the interface downward towards DUT. Therefore the Sequence driver only interacts with BFM for the purpose of driving data item into the DUT.
How to use sequences?
1. Define the sequence item struct - For an item to be used with sequences, it must have some common functionality.
type usb_pid_t : [SETUP = 0xD, OUT = 0x1 , IN = 0x9];
// Create the sequence item
struct usb_transaction_s like any_sequence_item {
dev_addr : uint (bits : 7);
ep_num : uint (bits:4);
pid : usb_pid_t;
data : list of uint (bits : 8);
};
2. Define the sequence and its driver using the sequence statement
// Define the sequence
sequence usb_sequence_s using
item = usb_transaction_s,
created_driver : usb_transaction_driver_u; // Name of the driver
created_kind : usb_transaction_kind_t; // Various sub types for the sequence
3. Hook up the sequence driver to the environment
Have a BFM that knows how to drive the USB packet to the DUT.
unit usb_bfm {
event usb_clk is rise ('usb_clk_30') @ sim;
drive_packet ( packet : usb_transaction_s) @ usb_clk is {
-------
------
}; // End of drive_packet TCM
}; // End of unit usb_bfm
The BFM is instantiated in the Agent
extend usb_bfm {
driver : usb_transaction_driver_u; // Reference to the sequence driver in the BFM
};
unit usb_agent {
bfm : usb_bfm is instance; };
extend usb_agent {
driver : usb_transaction_driver_u is instance;
keep bfm.driver == driver;
};
connect the pre-defined clock to the BFM clock
extend usb_bfm {
on usb_clk { emit driver.clock }; };
Pull item from driver, process it and inform through done
Instantiate the driver into the Agent
extend usb_bfm {
execute_items () @ clock is {
var sequential_items : usb_transaction_s;
while (TRUE) {
sequential_items = driver.get_next_item();
drive_packet (sequential_item);
emit driver.packet_done;
}; // End of while loop
}; // End of execute_item TCM
run() is also {
start execute_items ();
}; // End of run method
}; // End of usb_bfm
Saturday, September 20, 2008
Increase the operational speed of the circuit
- Use And-Or-Invert or Or-And-Invert gates wherever possible, since they are economical particularly for both area and speed.
- Feed the late arriving signals in your design late into the combinatorial circuit to balance the total gate delay along each path of the combinatorial circuit. To know more about late arriving signals, please go thorough it here.
- Use a maximum of 2 inputs on all combinatorial circuits in your design. For example, you can use two numbers of 2 input NAND gates and a 2 input NOR gate instead of using a 4 input AND gate.
- The bottom line is, if a boolean function with more than 2 inputs are decomposed into several simple gates, which results in more gates for the same function; but the total delay is reduced. According to the gate delay model, an N-input AND gate contains a branch with N transistors in series, resulting in an increased internal resistance of N*delta. Furthermore, the parasitic capacitance is also increased; therefore the internal delay of an N input AND gate is N(square)*delta. So if the NAND gate with 6 inputs is not decomposed, the internal delay will be rougly 0.7 ns as opposed to 0.42 ns with decomposition.
- Use Johnson counters instead of binary counters.
- An n-stage johnson counter produces a set of outputs of length 2n, which can be decoded to give a count sequence. The advantage of using this counter is that, having no combinatorial logic between flip-flops, it can be run at the maximum speed permitted by setup and hold time constraints. The disadvantage of a johnson counter is that, for a required count of m, it requires m/2 flip-flops, rather than log2(m) as required by a synchronous binary counter.
Thursday, September 4, 2008
Verilog questions
1. Is this a valid, synthesizable, use of a for loop?
module for_loop();
reg [8:0] A, B;
integer i;
parameter N=8;
always@(B)
begin
for (i=1; i<=N; i=i+1)
A[i-1]=B[i];
A[N] = A[N-1];
end
endmodule
A. assign A = B << 1;
B. assign A = B <<< 1;
C. assign A = B >> 1;
D. assign A = B >>> 1;
module (a, b, c, d, e, f, g);
input a, b, c, d;
output e, f, g;
assign e = a & b;
assign f = c ^ e;
assign g = d | f;
endmodule
A. {a, b, c, d} = 4’b0010;
B. {a, b, c, d} = 4’b1100;
C. {a, b, c, d} = 4’b1111;
D. {a, b, c, d} = 4’b0101;
E. None of the above
4. Consider the following two test fixtures.
// Fixture A
parameter delay1 =
parameter delay2 =
initial
begin
B = 1’b0;
#20 A = 1’b1;
#delay1 A = 1’b0;
#delay2 B = 1'b1;
end
// Fixture B
initial
fork
B = 1’b0;
#20 A = 1’b1;
#40 A = 1’b0;
#60 B = 1’b1;
join
For these two fixtures to produce the same waveforms, delay1 and delay2 have to be set
as follows:
A. delay1 = 40; delay2 = 60;
B. delay1 = 30; delay2 = 20;
C. delay1 = 30; delay2 = 30;
D. delay1 = 20; delay2 = 20;
E. None of these are correct
B. Most of the bugs in a design are due to poorly understood interactions between different modules.
C. This is the fastest way to verify the individual modules that make up the design.
D. Most of the bugs in a design occur because of poorly designed interfaces, e.g. buses.
E. None of the above are remotely a good reason.
6. Consider the following specify block:
specify
specparam A0spec = 1 : 2 : 3;
specparam A1spec = 2 : 3 : 4;
(a => b) = (A0spec, A1spec);
endspecify
This is defining the following:
A. Rising, falling and steady delay from input a to output b of 1, 2, and 3 ns respectively when a is 0, and 2, 3, and 4 ns when a is 1.
B. Minimum, typical and maximum delay from input a to output b of 1, 2, and 3 ns on a rising edge at B, and 2, 3 and 4 ns on a falling edge.
C. Non-blocking assignment of a to b with minimum, typical and maximum delay of 1, 2 and 3ns.
D. Setup time requirements for the flip-flop with output B.
Sunday, August 24, 2008
Power consumption
Determine your design components power consumption
The designers can do an RTL power analysis before the design is synthesized. This analysis can't be as accurate as Gate level synthesis. But it gives an overall idea of potential power saving. For example, how much power could be saved if block "A" could be powered down 65 percent of the time, or if block "A" operated at 0.8 volt rather than 1 V?
Accurate switching activity from your simulation
Thursday, July 24, 2008
Low power design
FINE GRAIN power gating requires that each cell come with its own sleep transistor.
Advantage
- Good timing control
- Increased area overhead
- Less leakage control
- Required a standard cell library with sleep transistor
Wednesday, July 23, 2008
Gray Code Counter Implementation
B : 000, 001, 010, 011, 100, 101, 110, 111
G: 000, 001, 011, 010, 110, 111, 101, 100
Binary to gray code can be achieved by
gray[2] = binary[2];
gray[1] = binary[2] ^ binary[1];
gray[0] = binary[1] ^ binary[0];
A simple verilog code to implement this function is given by
assign gray = (binary>> 1) ^ binary; // Right shift by 1 and EX-OR with binary.
module gray_cntr (
clock_in,
rst_n,
enable_in,
cnt_out
);
// I/O Declarations
input clock_in, rst_n, enable_in;
output [ 2:0] cnt_out;
wire [2:0] cnt_out;
reg [2:0] cnt;
always @ (posedge clock_in or negedge rst_n)
if (!rst_n)
cnt <= 1'b0;
else if (enable_in)
cnt <= cnt + 1'b1;
assign cnt_out = { cnt[2], (^cnt[2:1]), (^cnt[1:0]) };
endmodule
Saturday, July 19, 2008
Mixed Signal Modeling
Here are some of the simple examples that shows how to write the behavioral model for analog circuits.
RESISTORS
The equation for a simple linear resistor is V = IR where R is the resistance.
`include “disciplines.vams”
module res(p,n);
inout p,n; // Positive and Negative terminals
electrical p,n;
parameter real r=0 from [0:inf]; // R value is from 0 to infinity
analog
V(p,n) <+ r*I(p,n);
endmodule
TRIANGLE WAVE FORM GENERATION
module V_triangle_generator(out);
output out;
voltage out;
parameter real period = 10n from [0:inf],
ampl = 1;
integer slope;
real offset;
analog
begin
@(timer(0,period))
begin
slope = +1;
offset = $realtime;
discontinuity(1);
end
@(timer(period/2,period))
begin
slope = -1;
offset = $realtime;
discontinuity(1);
end
V(out) <+ ampl * slope * (4*($realtime-offset)/period - 1);
end
endmodule
You can download the Verilog-AMS language reference manual from here.
Monday, July 14, 2008
Serial to Parallel Data Conversion
A serial to parallel data conversion circuit is used for converting a serial word supplied by some domain "X" to a parallel word so as to allow for the processing of the parallel word by a processor. The "X" domain supplies to the interface circuit a 'ready' pulse signal. The interface circuit, in response to the 'ready' pulse signal, supplies an 'ack' pulse and a 'clock' signal to the "X", so as to allow the serial word from the "X" to be transferred to the interface circuit, which then converts the serial word to a parallel word. An enable pulse signal supplied to the interface circuit effects the transfer of the parallel word from the interface circuit to the processor.
module serial_2_parallel (
clk_in,
rst_n,
ready_in,
shift_enable,
serial_in,
ack_out,
parallel_out );
// I/O declarations
input clk_in;
input rst_n;
input ready_in;
input shift_enable;
input serial_in;
output [3:0] parallel_out;
reg [3:0] parallel_out;
output ack_out;
reg ack_out;
wire [3:0] parallel_wire;
// A 4-bit shift register to convert serial to parallel
always@(posedge clk_in or negedge rst_n)
begin
if(rst_n == 1'b0)
begin
parallel_out <= 4'b0;
ack_out <= 1'b0; // ack_out is initially 0
end
// Shift enable is driven from tb as 1 when ack_out is 1
else if (shift_enable == 1'b1 && ready_in == 1'b1)
parallel_out <= ({serial_in, parallel_wire[3:1]});
else
begin
parallel_out <= parallel_wire;
ack_out <= 1'b1;
end
end
// Declare a 4-bit wire
assign parallel_wire = parallel_out;
endmodule
Coverage driven Random Verification
To understand how to take advantage of this solution, cdn (cadence designer network) talked to Mr. Apurva Kalia, VP of R&D.
You can read his interview here.
Monday, June 16, 2008
RTL Design techniques - Coding style
Create a block level diagram before begin your coding
Draw a simple block diagrams of the functions of your design. This will also helpful in documentation. Use these block diagrams while code your design.
Always think of a fresher who read your RTL
Hierarchy
At the top level of your chip there should be 4 or 5 blocks: I/O pads, clock generator, reset circuit, and the core design. They are in separate blocks, because they might not be all synthesizable. Isolating them simplifies synthesis. Typically, the core design is hierarchical and organized by function.
Use separate always@ blocks for sequential logic and combinatorial logic
- It helps organize your RTL description
- There is a sequential optimization process in DC, which uses your coding style description of the sequential element to map it to the best sequential element in your technology library. When you combine sequential and combinatorial logic descriptions together, the tool can get confused and might not recognize the type of sequential element you are describing.
There is one good paper by Stuart Sutherland about the blocking and non-blocking assignments. This paper can be downloaded from here.
Know whether you have prioritized or parallel conditions
If the conditions are mutually exclusive, then a case statement is better, because it is easier to read and it organizes the parallel states of the description. If multiple conditions can occur at the same time, use the if statement and prioritize the conditions using else if for each subsequent condition.
Completely specify all branches of all conditional statements
If you completely specify all possible combinations of ones and zeros for the different cases and you use the same select operator for all cases DC will automatically recognize that case statement is fully specified and parallel.
Initialize output of conditional statements prior to defining the statements
Be careful selecting what value you initialize the output to. If there is't a default state for that part of the design then try to pick the most popular state to initialize the output to that should help reduce extra switching (power) during operation.
Use high level constructs (case, if, always@) as much as possible
Synthesis works best with high level RTL constructs. Low level gates or Boolean level constructs (verilog primitives) constrain DC.
Using good coding style and writing safe RTL code is not enough! Understand what you are implying and figure out in advance where are the potential problems. You should be able to manually synthesize in your head what you have described in your RTL description.
Sunday, June 15, 2008
RTL Design techniques - Pre-RTL Checklist.
There are many design issues - which impact the speed and area of the design - need to be resolved before you begin coding your design.
Communicate design issues with your team - Things to be worked out as a team
- Naming convention for hierarchical blocks,
- Naming convention for signals,
- Active low or active high states for the signal
Partitioning helps to break down your big design into smaller blocks and assign each small unit to different members of the team. Follow the specification's recommendation for partitioning.
What are the I/O requirements?
What about the clocks in the design?
How many clocks will be required for the design? Where are the clocks for the chip coming from? Will they be internally generated? PLL? Divide by circuits? Externally supplied clocks? You have to isolate your clock generation circuitry from the rest of the chip design. Especially if it is analog based.
What other IPs are you using?
Does the design require any extra IP (Intellectual Property) to be integrated into it? RAMs? Cores? Buses? FIFOs? Then start with the interface to each IP block and define it.
Is it your expectation that you are pin-limited or gate limited?
Being pin-limited means that you dont have enough I/O pads in your ASIC package to do what you really want to do. You might be able to double up on the functions of each pin, which would require multiplexing signals and would prevent any ideas of a unidirectional bus interface at the I/O pad level. But if you need all the signals to be active simultaneously, you wont be able to do it either. You'll have to split the design up. You should know before you begin your RTL.
Being gate-limited means that the design has too much functionality for the die size chosen. You might have to cut out functionality to fit on the die. Or you can try to optimize your design for area, which means speed objectives might be tough to meet. It is hard to estimate whether you will be gate limited at the beginning of a project unless you have been through this design before.
Is it your expectation that you will be pushing the speed envelope of the technology?
- How much functionality are you putting into your design
- At what speed will it be running?
- What technology are you going to use to implement it?
- Has it ever been done before?
- What changes to the design are you willing to make to achieve the speed goal for your design? Pipelining or Register re-timing.
Wednesday, June 11, 2008
Fact about Johnson counter
Tuesday, June 10, 2008
What is Pipelining?
- Attach the wheel to the car,
- Attach the engine,
- Attach the seats,
- Attach the body and
- Paint everything.
PIPELINING
Let us assume that we have a design that can be implemented as a series of blocks of combinational logics. Let's assume that we have a chunk of 3 combinational blocks. Let us say each block takes "t" nanoseconds to perform its task. In this case, it will take "3t" nanoseconds for a word of data to propagate through the function, starting with its arrival at the inputs to the first block and ends with its departure at the output pin of 3rd block.
We wouldn't want to present a new data to the inputs until we have stored the output results associated with the first word of data. The answer is to use a pipelined design technique in which the block of combinational logic are sandwiched b/w block of registers.
All of the register banks are driven by a common clock. On each active clock edge, the registers feeding a block of logic are loaded with the result from the previous stage. These values then propagate through that block of logic until they arrive at its outputs, at which point they are read to be loaded to the next set of register on the next clock. In this case, as soon as the pipeline is fully loaded, a new word of data can be processed every "t" nanoseconds.
Monday, June 9, 2008
Re-Timing
For example, let us assume a pipe-lined design, whose frequency is such that the maximum register to register delay is 15ps. Now, let us assume that we have a situation as shown in Figure.
Saturday, June 7, 2008
Ten Tips to Improve an IC Design Teams Project Execution
This press release can be viewed from here.
Saturday, May 31, 2008
VHDL vs Verilog
VHDL allows users to define their own data types which allows users to extend the language. Also, support for libraries and packages lends itself to more complex models.
