Jump to content

Simple AMS examples


Recommended Posts

Hi All,

I am currently working with memristors (non-linear resistors with memory effect) that I am modeling in SPICE. I would like to cross check if a SystemC-AMS implementation would give sufficient results in terms of accuracy.

To start with I would like to use simple resistor circuits with a sine voltage for example. This I would than adapt step by step to my final setup.

So basically what I am looking for is an example file that has a source, one or two resistors and as less as possible overhead.

Can anyone point me to such a source or does anyone have that done and would like to share it? :)

Thanks in Advance

Jens

Link to comment
Share on other sites

Hello,

Could you be a little bit more specific ? For example, you state:

"To start with I would like to use simple resistor circuits with a

sine voltage for example. This I would than adapt step by step

to my final setup."

To achieve this, you could simply use SystemC-AMS's ELN

framework, along with the TDF framework. The built-in sca_eln::

sca_r class would provide the resistors and the sine wave

would come from a TDF module. Converter ports would

transfer data back and forth between ELN and TDF objects.

Please be aware that the built-in ELN types are all linear,

and I doubt you would you would be able to get the memriator

hysterisis ("bow-tie") curve with ELN components. Why not

use TDF modules only, both to model the sine source as well

as the resistor chain, that is use only equations to model the

memristor. A few online SPICE examples use similar approach.

So, is there something special about the resistor configuration

that you are trying to use ?

Hope that helps.

Link to comment
Share on other sites

Dear Jens,

when you are so particular about verification/comparison of SPICE design with some reference models, in case of memristors which are quite a strong non-linear device, SystemC-AMS will fail to be beneficial. Without entering the context of linear/non-linear solver, I would like to focus on the reason of this inadequacy is that you want to verify your micro architecture model and SystemC-AMS is a macro-architecture design language (at least most of it).

I would like to suggest you to use Verilog-AMS instead. Many people fail to visualize Verilog-AMS as an analog verification language and yours is one such case where back-to-back verification of your spice model can be efficiently performed using Verilog-AMS stimulus and reference model.

Please let us know if you still needs help here.

Regards,

Sumit

Link to comment
Share on other sites

Hi,

I am sorry for the late reply. I didn't realize you guys did write something.

@dakupoto

Yes, your suggestion about putting an ELN module within the TDF framework is the way to go. And with some examples from the User guide and the LRM I just got it running. Thanks for your input.

However, I after reading through the documents and trying to understand the concepts of the whole AMS extension I consider your idea of just using TDF. I have to ways to describe the mermistor - either purely mathematically (in TDF then probably) or build by ELN components like resistors and some voltage controlled current sources.

@Sumit

Thanks for your response. These are some good points you made.

You are right that at this point I want to verify how well SystemC-AMS can model a memristor. But this is just a first step of creating a higher level simulation framework that would incorporate memristors. In later steps I would than use SystemC more on the macro level.

I am aware of the fact that I am not replacing SPICE with that and that the simulation results will not be as accurate. But this is the purpose of this experiment. Trying to figure out how much accuracy one can trade off for simulation speed and system integration.

You mentioned the non-linear solver. Can you give me some more information on that? What are your concerns? Maybe you can point me to some documents I could study.

Using Verilog-AMS might be an option. But does it give significant better results for non-linear problems than SystemC-AMS does? Verilog-AMS is supposed to simulate some orders of magnitude faster than SPICE ("On the Simulation Performance of Contemporary AMS Hardware Description Languages"). But this speed improvement has to be based on some generalizations I guess.

I would appreciate any further comments from you that would help me better estimate chances and limitations of SystemC-AMS in this context.

Thanks a lot (and sorry again for the late reply)

Jens

Link to comment
Share on other sites

Hello Jens,

regarding the late reply due to lack of notification: This is a weakness of the new forum. You have to configure e-mail notifications manually by clicking on your account name on the top right of the web page and then clicking on My Settings. There you can configure to receive e-mail notifications for followed forums and threads. Afterwards, you still have to select the forums and threads to follow.

Regarding your actual modeling problem. If you want to model a memristor in SystemC-AMS, then I agree that a TDF-only solution would be preferable. However, then you'll have to make a choice upon model creation on which causality you assume for the Memristor, i.e. how it is operated. Is it driven by a current or a voltage? This will fix its state and output variable. Then, you'll be able to express you memristor equations in a compact TDF model using e.g. an embedded LTF function for the integration of the current and implementing the non-linear M(q(t)) function inside the processing() member function.

An implementation combining ELN and TDF will be suboptimal, as it will imply a tight feedback loop between a controlled resistor and a TDF module implementing the non-linear part of the Memristor equations, which has to be broken with a 1 timestep delay. This causes of course a change in the dynamic of your system and in consequence your simulation results will heavily depend on the chosen TDF timestep.

Sumit's remarks on SystemC-AMS not being the most suited modeling language for describing circuit-level behavior are valid. LSF and ELN are limited to describing linear (switched) dynamic behavior and trying to model nonlinear behavior with them by combining them with tightly coupled TDF modules leads to suboptimal results. It's a simulation framework intented for the system-level, where most of the circuit level details have been abstracted away to focus on the system architecture and evaluate specifications for whole signal processing and control chains, which contain a significant amount of digital Hw/Sw. In contrast to VHDL-AMS and Verilog-AMS, SystemC-AMS does not offer a nonlinear network MoC, which allows you to solve nonlinear DAEs. Though, Fraunhofer IIS/EAS in Dresden have developed one, which integrates seamlessly into SystemC-AMS, you can check out the publication of Thomas Uhle in SOCC 2010 on it. However, it is not available as open-source.

Therefore, VHDL-AMS or Verilog-AMS may still be a more appropriate choice for your needs.

Best regards,

Torsten

Link to comment
Share on other sites

I second Torsten's statement :

regarding the late reply due to lack of notification: This is a weakness of the new forum. You have to configure e-mail notifications manually by clicking on your account name on the top right of the web page and then clicking on My Settings. There you can configure to receive e-mail notifications for followed forums and threads. Afterwards, you still have to select the forums and threads to follow.

I do not like this too.

Further-more it says both myself and Torsten are newbies :(

Jens:

Torsten gave fantastic replies to your queries. If you still have queries, please let us know.

Sumit

Link to comment
Share on other sites

Hello Sumit,

Further-more it says both myself and Torsten are newbies :(

If I understand this forum correctly, then Newbie is a reputation automatically determined by:

  • the number of posts
  • the number of likes you receive by others on your posts, and
  • maybe the number of friends you have on the forum.

So it may make sense to take the time to "like" the posts you find valuable.

Best regards,

Torsten

Link to comment
Share on other sites

Hi,

Torsten, thanks for your detailed feedback.

I understand that you are rather skeptical about this idea of memristors in SystemC-AMS. And I can follow your argumentation.

However, my stubbornness demands trying it out myself to make a better judgement on memristors in SystemC-AMS as well as the overall capabilities. :)

I will follow the advice of sticking to TDF in a first step.

Contrary to me, it seems that you are knowing what it takes to implement a memristor in SystemC-AMS. If by any chance you have some material on that (cpp file, short paper, etc.), I would really appreciate further support.

@Sumit,

Belated, I also liked your post to my question. I hope you can get rid of this shameful "newbie" status as soon as possible :)

cheers

Jens

Link to comment
Share on other sites

Hello Jens,

I cannot provide you with links to working memristor model for SystemC-AMS. However, a quick search on Google returns relevant material, which may serve as a starting point:

Personally, I like the bond graph formulation (cf. to Karnopp, Margolis, Rosenberg: "System Dynamics") of the memristor model, as it allows for a straightforward transformation of your model into an equivalent block diagram model, which can be expressed using TDF, by means of causality analysis. For the implementation, my hints from my previous post apply.

Regards, Torsten

Link to comment
Share on other sites

  • 7 months later...

Hello,

 

file_in_tdf is not part of the SystemC AMS 1.0 standard. Therefore, you will have to elaborate more on your question.

 

To get started, I suggest you to download the SystemC AMS LRM and User's Guide from <http://www.accellera.org/>. The User's Guide is then a good starting point for your reading.

 

Anyway, it would be better to start a new thread with your question than kidnapping an old thread on a different topic.

 

Best regards,

 

Torsten

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...