Dear,
thanks for the response and for posting the links.
I read carefully your post about the use frequency as variable in SP simulation, but I still didn't understand the correct use of the frequency. I try to explain better my problem.
I created a veriloga module and I created a two-port schematic to handle the device. In File --> DesignParameters, I used the following settings Model: Built-in Component, Simulate As:
behavioral_device (that is actually the name of the va module). Then in the tab Parameters I added a variable
myfreq, Real value, Parameter Type: Frequency.
This is the actual expression I have to model (MATLAB). The vout depends on the voltage input and the frequency. This is a behavioral model and the frequency is treated like any other variable. I know this sounds weird, but for the moment this is my purpose: try to understand the behavior of the model.
Code Verilog - [expand] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| vout = 1.012951e-02 - 5.467839e-04 * (1i*(2+freq)) + 2.945357e-02 * (1i*(2+freq))^2 + 4.125639e-03 * vin - 8.450533e-03 * (1i*(2+freq))^3 + 3.018920e-03 * vin * (1i*(2+freq))[/CODE]
This is my va module:
[syntax=verilog]module sumo_filter(in,out);
input in;
output out;
voltage in,out;
parameter real myfreq = 1M from (0:inf);
analog
V(out) <+ ...;
endmodule |
If I insert the new device in a schematic and if I perform an AC simulation the frequency is swiped only if it is inserted in a laplace expression (see in the previous post). Otherwise the module takes the default value for the var "
myfreq". Notice that in the schematic AC simulation I'm only able to put myfreq = 1KHz.
if I try to set
myfreq=freq (AC simulation) I got the error
Code Verilog - [expand] |
1
| Improper frequency dependence in 'behavioral_device' parameters. |
Thanks,
Luke