The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> AMS Simulators >> working with wreal variable
https://designers-guide.org/forum/YaBB.pl?num=1312886872

Message started by SARAM on Aug 9th, 2011, 3:47am

Title: working with wreal variable
Post by SARAM on Aug 9th, 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

Title: Re: working with wreal variable
Post by boe on Aug 9th, 2011, 6:30am

SARAM,

Tool? Version?

B O E

Title: Re: working with wreal variable
Post by SARAM on Aug 9th, 2011, 9:12am

I use Verilog AMS in Cadence Version 5.10.41

Title: Re: working with wreal variable
Post by boe on 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

Title: Re: working with wreal variable
Post by SARAM on 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

Title: Re: working with wreal variable
Post by boe on 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

Title: Re: working with wreal variable
Post by SARAM on 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

Title: Re: working with wreal variable
Post by boe on 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

Title: Re: working with wreal variable
Post by SARAM on 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

Title: Re: working with wreal variable
Post by boe on 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.

Title: Re: working with wreal variable
Post by SARAM 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?
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

Title: Re: working with wreal variable
Post by boe on 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

Title: Re: working with wreal variable
Post by SARAM on 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

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.