Jump to content

Recommended Posts

Hi everyone,

 

I have been working with SystemC-AMS lately and having nice results, but now I'm facing some issues with the sca_eln::sca_tdf::sca_vsink module. I created some sc_modules with ELN modules inside. Quite briefly, the final electrical network (which I get from putting those sc_modules together) that I have been having problems with is:

 

ELN: node_ref -> vsource -> node -> vsink -> node -> r -> node -> vsink -> node -> r -> node_ref

SC :|-----GENERATOR-----|->|-----------PIPE-----------|->|----------PIPE------------| -> |---SINK---|

 

If understood correctly the sca_eln::sca_tdf::sca_isink module is like a voltage source with v = 0 V, so they should not be connected in parallel. I do not know if the vsink works in a similar way, being a current source, so there should not be two connected in a row. Taking a look at the Users guide it is noted for both modules that "No equation added to the equation system", so I'm not sure if this is a conflict because of what I just mentioned.

 

The error I'm getting is:

 

Error: SystemC-AMS: Initialization equation system failed in sca_linear_solver_0: 1
  the error is in the following net (max. 50):
    g1.vsource
    p1.vsink
    p1.r1
    p2.vsink
    p2.r1

The error is may  be near:
        p1.sca_eln_node_1  and
        p2.sca_eln_node_0

 

I would like to know the reason why this is not working, if anyone happen to find any :) The idea of having vsink's there is because I want to send the value from the electrical network in that spot to a TDF module. I'm not sure if this is ok or is a crazy idea.

 

I hope I explained everything clearly, otherwise, just ask and I'll try to do it better :)

 

Thanks a lot!

 

Kike

Share this post


Link to post
Share on other sites

Hello Kike,

the vsink has no influence on the network - it simple takes the voltages (the difference) from the connected nodes and convert them to a tdf signal. So the vsink is an open - in opposite to the isink, which is a short cut.

 

I'm afraid that you used the vsink like the isink - on this way your resistors will be floated (not connected / no path to a reference node). Thus the solver cannot calculate a voltage to the reference node.

 

If I'm wrong, please send me the netlist (SystemC-AMS description) of the network.

 

best regards

Karsten

Share this post


Link to post
Share on other sites

Hi Karsten,

 

Thanks for the answer.

 

I may not be using the vsink in a proper way (maybe like isink). As I noted in the previous post, the sequence of my resultant electrical network is this:

 

node_ref -> vsource -> node -> vsink -> node -> r -> node -> vsink -> node -> r -> node_ref

 

 

Info: SystemC-AMS:
    9 SystemC-AMS modules instantiated
    2 SystemC-AMS views created
    5 SystemC-AMS synchronization objects/solvers instantiated


Info: SystemC-AMS:
    1 dataflow clusters instantiated
      cluster 0:
        5 dataflow modules/solver, contains e.g. module: sca_linear_solver_0 containing modules (max. 5 printed):
        g1.vsource
        p1.vsink
        p1.r1
        p2.vsink
        p2.r1

        5 elements in schedule list,  
        100 ms cluster period,
        ratio to lowest:  1              e.g. module: sca_linear_solver_0
        ratio to highest: 1 sample time  e.g. module: sca_linear_solver_0
        0 connections to SystemC de, 0 connections from SystemC de


Info: SystemC-AMS:
    ELN solver instance: sca_linear_solver_0 (cluster 0)
        has 7 equations for 5 modules (e.g. g1.source),
        2 inputs and 2 outputs to other (TDF) SystemC-AMS domains,
        0 inputs and 0 outputs to SystemC de.
        100 ms initial time step


Error: SystemC-AMS: Initialization equation system failed in sca_linear_solver_0: 1
  the error is in the following net (max. 50):
    g1.vsource
    p1.vsink
    p1.r1
    p2.vsink
    p2.r1

The error is may  be near:
        p1.sca_eln_node_1  and
        p2.sca_eln_node_0

 

If I'm doing it wrong, what should be the proper way to use a vsink and a resistor? Do I have to use a Reference Node instead of a simple node?

 

Thank you again :)

Share this post


Link to post
Share on other sites

Ok, setting the vsink's in parallell with the resistors it works when it comes to the basic ELN.

 

But in the configuration with my sc_modules:

 

node_ref -> vsource -> node ->   r  -> node ->   r  -> node_ref

                                                        |->   vsink  ->|           |-> vsink   ->|

 

I have the following error:

 

Error: SystemC-AMS: Reinitialization failed in sca_linear_solver_0: 1
  during reinitialization equation system at 0 s (dt = 0.1).
  the error is in the following net (max. 50):
    g1.vsource
    p1.vsink
    p1.r1
    p2.vsink
    p2.r1

Parameters of the following modules changed for the current time step:
    p1.r1 changed to 0
    p2.r1 changed to 0

The error is may  be near:
        p2.r1

In file: /home/guest/Build/systemc-ams_1.0_patched/src/scams/impl/solver/linear/sca_linear_solver.cpp:367
In process: sca_implementation_0.cluster_process_0 @ 0 s
SystemC: simulation stopped by user.

 

 

I'm still not sure why :wacko:

Share this post


Link to post
Share on other sites

Think of isinks and vsinks as current meters and voltage meters. Like in reality, you have to connect them, respectively, in series to the branch, in which you want to measure the current, in parallel to the branch, across which you want to measure the voltage. So in your case, you have to connect the vsinks in parallel to the resistors.

 

The reinitialization of your equation system error likely stems from the fact that you chose a resistance value of zero (i.e., you short circuited two nodes) for both resistors. In consequence, the current through the voltage source cannot be determined by the solver of the ELN MoC.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×