The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 3rd, 2024, 10:15am
Pages: 1
Send Topic Print
working with wreal variable (Read 11195 times)
SARAM
Junior Member
**
Offline



Posts: 12

working with wreal variable
Aug 09th, 2011, 3:47am
 
I have a file that contains my waveform. and i want to feed it to my system at certain clk time. i wrote this code :
sometime when i check the the output some of samples are missed.
and they are not sync with the posedge clk.( wreal D flipflop)

module wrealdff(in,out,clk)
input clk,in;
output out;
wreal in,out;
real temp;
always @(posedge clk )
temp=in;
assign out=temp;

endmodule

is this code correct?
please help
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: working with wreal variable
Reply #1 - Aug 9th, 2011, 6:30am
 
SARAM,

Tool? Version?

B O E
Back to top
 
 
View Profile   IP Logged
SARAM
Junior Member
**
Offline



Posts: 12

Re: working with wreal variable
Reply #2 - Aug 9th, 2011, 9:12am
 
I use Verilog AMS in Cadence Version 5.10.41
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: working with wreal variable
Reply #3 - Aug 9th, 2011, 11:33am
 
SARAM wrote on Aug 9th, 2011, 3:47am:
...
is this code correct?
No. There is a syntax error: Code:
module wrealdff(in,out,clk); 


Then it seems to work with Cadence (IUS 9.20).

B O E
Back to top
 
 
View Profile   IP Logged
SARAM
Junior Member
**
Offline



Posts: 12

Re: working with wreal variable
Reply #4 - Aug 10th, 2011, 1:08am
 
Hi BOE,
Thanks.
sorry I forgot to put ';'.
attach please see the input source and use this code and see the output.
the clk frequency is 61.44 MHz. the input data also sample at this clk before.
when I checked the input output and clk and display the point in the figure. the output is not sample at clk and sometime miss some points.
of rising edge.

Thanks in advance
Back to top
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: working with wreal variable
Reply #5 - Aug 10th, 2011, 3:02am
 
SARAM ,

Testbench? Which version of AMS Designer do you use?

OK, I only ran a few clock cycles with my own TB, but it seemed to work fine.

B O E
Back to top
 
 
View Profile   IP Logged
SARAM
Junior Member
**
Offline



Posts: 12

Re: working with wreal variable
Reply #6 - Aug 10th, 2011, 3:53am
 
Hi BOE,
Attached you can see test bench and results,
you can see the module does not operate at the clk and the output is totally distorted.

I use IUS 8.2.

Thanks
Back to top
 

Screenshot-1_006.png
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: working with wreal variable
Reply #7 - Aug 10th, 2011, 6:55am
 
Hi SARAM,

For me it works (IUS 9.20) - clk period is 2 us. See Image.
Do you use AMS? Do you use sample&hold mode for waveform display?

B O E
Back to top
 

wrealDff.png
View Profile   IP Logged
SARAM
Junior Member
**
Offline



Posts: 12

Re: working with wreal variable
Reply #8 - Aug 10th, 2011, 7:08am
 
Hi,

yes I use AMS but I did not see the wave form in simvision.
I run in batch mode not inteactive. and use it to display figure.
when I check the signal you can see it is not correct.
I do not use S/H.
How do you read file to AMS? I use vpwlf. would you please try to read it and display the point like me an you will see the effect.


Thanks
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: working with wreal variable
Reply #9 - Aug 10th, 2011, 7:21am
 
SARAM,

If you use vpwlf, you need an E2R connect module to convert the output voltage to wreal. Which connect rules do you use?

Note that the default connect rules use the absdelta event with delta=Vsup/64. Your input signal is probably too small compared to this delta.

B O E

[Added] PS: I suggest to try file I/O ($fopen, $fscanf, $fclose) for stimulus generation in your case.
Back to top
 
 
View Profile   IP Logged
SARAM
Junior Member
**
Offline



Posts: 12

Re: working with wreal variable
Reply #10 - Aug 10th, 2011, 8:00am
 
I think I used default connect rules.
Type: built_in
Rules Name: ConnetRules_18V_full_fast

how can i change this value?
one more thing, the file is sampled equi distances but when i see the figure and show the the points i see variable sampling that somehow it is not related to my input file. why is that?

I am sorry that asking lots of questions.

Thanks
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: working with wreal variable
Reply #11 - Aug 10th, 2011, 10:44am
 
SARAM wrote on Aug 10th, 2011, 8:00am:
I think I used default connect rules.
Type: built_in
Rules Name: ConnetRules_18V_full_fast

how can i change this value?
Read the (AMS designer) documentation.
Quote:
one more thing, the file is sampled equi distances but when i see the figure and show the the points i see variable sampling that somehow it is not related to my input file. why is that?
Check the output of your vpwlf source and compare with the input of wrealdff. You will see that the interface element between the "analog world" (signal discipline electrical at vpwlf) and the "digital world" (wreal) transfers changes only from the analog to the digital domain if the analog input has changed by more than some mV. Otherwise the simulation of the digital part would be slowed down.
For more details refer to Verilog-AMS LRM on absdelta events.

B O E
Back to top
 
« Last Edit: Aug 10th, 2011, 12:36pm by boe »  
View Profile   IP Logged
SARAM
Junior Member
**
Offline



Posts: 12

Re: working with wreal variable
Reply #12 - Aug 11th, 2011, 12:58am
 
Hi,

Thanx for your help. I have tried to use the system task function $fread
It works pretty fine.

Thanks once more
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.