Jump to content

Elvis

Members
  • Content count

    12
  • Joined

  • Last visited

  1. Ok, that solves the problem of compiling the sources. It is interesting that the same PoC would compile in one machine (RH6) and not compile (compile after the suggestions) in an ubuntu. The only thing which is different is the version of the g++ compiler which in RH6 is older. Are there other things to take into consideration? In addition, at the moment I am running an example which is working in RH6 but is not working on the newer Ubuntu (Simple low-pass filter).
  2. I will try that. Thank you. Question more for the @COSEDA folks. Any idea when we can download the new PoC?
  3. Hi, installing the SystemC-AMS Poc on a new machine with ubuntu-18.04 LTS. All other programs install without issues. SystemC also nicely installing and working. When I try to compile the SystemC-AMS now it gives me error: ========================================================================================================= make[6]: Entering directory '/home/elvis/mProgram/systemc-ams-2.1/src/scams/impl/predefined_moc/tdf' CXX sca_ct_delay_buffer.lo CXX sca_delay_buffer_base.lo CXX sca_tdf_ct_ltf_nd_proxy.lo sca_tdf_ct_ltf_nd_proxy.cpp: In member function 'void sca_tdf::sca_implementation::sca_ct_ltf_nd_proxy::setup_equation_system()': sca_tdf_ct_ltf_nd_proxy.cpp:292:2: error: 'memset' was not declared in this scope memset((void*) (num2_ltf), 0, new_memsize * sizeof(double)); //set all to zero ^~~~~~ sca_tdf_ct_ltf_nd_proxy.cpp:292:2: note: suggested alternative: 'wmemset' memset((void*) (num2_ltf), 0, new_memsize * sizeof(double)); //set all to zero ^~~~~~ wmemset sca_tdf_ct_ltf_nd_proxy.cpp:316:3: error: 'memcpy' was not declared in this scope memcpy((void*) num2_ltf, (void*) num_ltf, num_size * sizeof(double)); ^~~~~~ sca_tdf_ct_ltf_nd_proxy.cpp:316:3: note: suggested alternative: 'wmemcpy' memcpy((void*) num2_ltf, (void*) num_ltf, num_size * sizeof(double)); ^~~~~~ wmemcpy Makefile:491: recipe for target 'sca_tdf_ct_ltf_nd_proxy.lo' failed make[6]: *** [sca_tdf_ct_ltf_nd_proxy.lo] Error 1 ========================================================================================================= I get from other colleagues who try (also in other distributions having issues on the -AMS installation part (never on the SC part). Maybe the SC-AMS folks need to do some more testing over several environments. Does anyone have an understanding on my error? what can i do to fixed it? I have followed the guidelines (as in the other machines/distribution I used it)
  4. Elvis

    SystemC-AMS vs RNM

    When it comes to modelling, you open the door to so many things. There are more options nowadays and It really depends on more things like: what effects/features you want your model to show? Is it a model for verification? is it for IP design? Is it a model you want to deliver to your customer? I don't believe there is one tool for everything. As usual, you need the right tool for the right task. Finally, it depends also on one modelling skills. While is common to talk about design and verification skills. It is also common to forget that modelling requires special skill-sets and understanding. RNM has been for me enough good on many occasions. However, depending on what you want to model it might not be anymore the right tool out there. Can you give an example of an IP you are trying to model and what kind of effects you want to model?
  5. Elvis

    C-API for SC-AMS

    Hi, Thanks, for the explanation. If the intention is that of staying within SystemC/C/C++ then, this is a closed System which works well. It can do great things in a cost-effective way. However, I think this would be a minimalist way of looking at the application. In the everyday work, models do exist in different environments and I would like to reuse them rather than redo them. If someone has a model in Octave, I want to link to it (Octave, also describes ways to use it with other applications). If there is a model in spice (ngspice) I want to link to it and use it. If someone has a model in Verilog. I want to use it too. In the same way, models available in SC/SC-AMS should be easily re-used in other application/external tools without needed to REwrite the SC* model into another language (which might come with pain anyway). So this is really not trying to reinvent the wheel all the time and being productive. Also, REDOing them means spending extra money and time and if these are not an issue, there might be technical implications like missing expertise in teams and/or limitation of that particular environment. Other examples are: connecting the output of your model to different processing libraries (could use a file but is not the point here) in real time and based on that, change the stimuli/parameters. Shipping to costumes and/or interfacing with their environments Interacting with hardware (an FPGA or an analogue test-chip) If as you say we develop a system and prototype it within SC-AMS, It would be good to move vertically between prototype level and implementation level by means of REusing the already developed model. This is the best way to communicate intention and execute the model at different levels vertically. If the environments, system-level design and implementation level design, are different there need to be a way to enable what I mentioned. So, I believe that an expert programmer can get around and find more solutions, but I am an engineer and I design circuits and do models of them, and I feel my time needs to go more into this direction rather than trying to solve the software problem. In my simple example, I have an RC filter (ELN) with a TDF driver. Self-contained all is fine. But when I want to use a C-Program to change the input of the filter instead... I can get into so many troubles and I am already wrapping C++ into C- supported structured and referring to them as "extern" all in a "C-API". I will accept that I have limited knowledge to cover this topic, but I am also seeing that there are not many examples around (books, LRM, SC-AMS user guide, conferences). Other tools (some I mentioned) are seeing integration and interfacing being important and therefore they provide documentation, examples and eventually the full API. The same applies to SC/SC-AMS. Answering your question... This is what is missing. I think. I like this quote from Ezra Pound. “The sum of human wisdom is not contained in any one language, and no single language is capable of expressing all forms and degrees of human comprehension"
  6. Hi, ngspice has a nice documentation on how it can be compiled as a shared library and also makes available a C-API for the application code to use it. examples.. ngspice-octave, etc... See chapter 19 of: http://ngspice.sourceforge.net/docs/ngspice-27-manual.pdf Is this something the folks on the SC-AMS committee or in the working group could consider. A C-API for SC-AMS would be an added value and make the standard more attractive. In the meantime, I have seen some books and searched online but there is not much I found. Does anyone has some links ? Elvis
  7. Thanks for the code template. "As this question touches very basic concepts of SystemC (AMS), I recommend you to read a good introductory text on SystemC and SystemC AMS.". Your point is well taken here. Sometimes, is hard to spot the solution to your problem by just going through the LRM. It comes down to having acquired a certain level of experience :). Thanks again, Elvis
  8. Hi, I came across the ConnectPorts between TDF and Discrete domain models..... In this case for the discrete domain is intended a System-C model, therefore, we go from classes to classes. The question I have is: How to connect in an efficient way a sc_signal<double> with a variable of type double? sc_signal<double> myscd; double myvar; having the above defined, what is a good way to do (a made up code): assign myscd = myvar; and assign myvar = myscd; I usually have to use the .read() and .write() methods but how can I achieve a permanent assignment? assuming that all that I want to do is manipulate simple variables. The same would apply to other data types (int, logic etc....)
  9. Thank you, I forgot that I can use the input argument to the sc_main. However, as you mentioned this is not the way for more complex simulations. In fact, the external program does not have to be necessary a testbench, it can be another model, maybe it can be a tool who processes the model output and it would be nice to see some examples of this kind of interface with SC/AMS. Moreover, C represents a bridge towards more other tools. Regarding the restart option, yes, I am aware that I cannot restart simulation once a sc_stop() has been sent but that is ok for me. I will have a look at the references you provided but I am assuming they will not discuss the scenario as per this thread. I have googled a bit but there seems not to be enough on this while I think it might be important....
  10. Hi, I am calling SC model from a program with its own unit... While calling a function which advances the simulation time I noticed the following behaviour: --- the function which is called from outside is: void advance_sim(double simtime) { cout<<"@"<<sc_time_stamp()<<". Advancing Simulation time by "<<simtime<<" ns"<<endl; sc_core::sc_start(simtime, sc_core::SC_NS); } When I use SC_FS/PS/NS as time unit all is ok. When I use SC_US/MS/SEC I get a segmentation fault (core dump). Has anybody seen this before? It looks wired to me. If my code was not correct, why would this work for unit <= NS ? Thanks, Elvis
  11. Hi, Thank you for your answer. The problem I am trying to solve is, I think, generic. I.e. I want to use my SystemC/AMS model from an external C program. The body of the model is: sca_util::sca_trace_file *tfp = NULL; SCAClass* aC; // this is a pointer to a class contain an sc_signal<double> int sc_main(int argc, char* argv[]) { // analog signals sca_eln::sca_node node_in; sca_eln::sca_node node_out; sca_eln::sca_node_ref gnd; aC = SCAClass::Instance(); // instantiate a voltage source sca_eln::sca_de_vsource src("src", 1.0); // discrete event voltage source with an initial value of 1 src.set_timestep(0.5, sc_core::SC_US); // time-step for voltage source src.inp(aC->sig); src.p(node_in); src.n(gnd); // RC filter rc_eln dut("dut"); dut.in(node_in); dut.out(node_out); // open simulation trace tfp = sca_util::sca_create_vcd_trace_file("rc_filter.vcd"); sca_trace(tfp,node_in,"node_in"); sca_trace(tfp, node_out,"node_out"); sca_trace(tfp, aC->sig,"sig"); sc_core::sc_start(0, sc_core::SC_MS); cout<<"@"<<sc_time_stamp()<<". Started SystemC-AMS Scheduler"<<endl; return(0); } I basically would like to have some function I can call from the C program which: 1) initializes all what is needed. 2) changes the value of the class member. in this case the sc_signal<double> 3) advances the simulation time 4) stops everything with a clean exit. I have created C_API for the class and class functions but Its clear that i am still missing bits.... How can I do this. my SystemC-AMs model will likely be called/loade as a shared library. Thanks again.
  12. Hello Folks, I have a simple RC-Filter (eln) driven from a discrete controlled voltage source. When I run this stand-alone, as an executable, all is fine, I get the traces etc... But, when I call this from an external C-Programm, I get the segmentation fault with no much information. the external C-program is actually doing nothing more than calling the sc_main, so that it can run the integrated small stimuli (the same used when I run the SC_model alone. Any idea why that might happen? Elvis
×