Jump to content

dakupoto

Members
  • Content Count

    252
  • Joined

  • Last visited

  • Days Won

    8

Reputation Activity

  1. Like
    dakupoto got a reaction from sumi29 in "Reading" a file and passing it as input   
    Hello,
    I am afraid you have run into the limitations of C++ templates, and a
    viable option is to use your own custom channel. To achieve that,
    you have to :
     
    1. create a custom interface - sub-class of sc_core::sc_interface
    2. create a class that implements the interface - the channel
    3. create a custom port to read in strings from your custom channel
     
    Because of the limitations of C++ templates, there is no generic way to
    tackle strings. You see for all the pre-defined port types in SystemC, the
    size of the data type is fixed (int 'x' bytes, double 'y' bytes etc., ) But
    there is no fixed size for a string -- how would the SystemC elaboration
    step assign space for it ? So, one has to create one's own channel
    and port. Hope that helps.
  2. Like
    dakupoto got a reaction from mohitnegi in data structure with link list   
    Hans is absolutely right. As a linked list cannot be implemented in hardware, they cannot be used in synthesis.
    In a similar vein, using SC_SPAWN, SC_JOIN macros to instantiate/close dynamic processes is also unwise
    as dynamic processes can never be implemented in real hardware.
  3. Like
    dakupoto got a reaction from karandeep963 in Weak Vtables in SystemC Library   
    Hello Sir,
    Vtables are a feature of the underlying C++ language, as SystemC is a C++
    library, that feature is carried over. But, the developer really does not have to
    know about how vtables are implemented, to make C++ virtual functions work.
  4. Like
  5. Like
    dakupoto got a reaction from karandeep963 in sc_signal v/s sc_buffer   
    Hello,
    "sensitive" indicates that the thread will always respond to any
    changes in the data coming in via a specified port. Note the word
    "any". You could restrict what changes the thread would respond
    to, e.g., to the positive edge of the signal, by specifying :
    "sensitive << <signal_name>.pos();"
    As for the other points that you wish to clarify/verify, please
    create small examples, compile and run them and see what the
    output is, or what the error messages are. This will be the best
    way to get a grip on how things work internally. Hope that helps.
     
  6. Like
    dakupoto got a reaction from jb22 in Simple AMS examples   
    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.
  7. Like
    dakupoto got a reaction from maehne in Simple AMS examples   
    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.
  8. Like
    dakupoto got a reaction from maehne in Deleting dynamic objects   
    From pure C++ point of view, it is just bad practice to use a
    'new' and not have a matching 'delete'. A lot of people code
    with a 'set of pants' approach and are not very sure when
    exactly to invoke delete. So they just hope that the SystemC
    kernel take care of this messy issue, and with small examples
    it works out fine. But think about what would happen, if, as I
    had to recently, to tackle a design with 128 64-bit parallel-in
    serial-out shift registers.
    Then again, a lot of people use SystemC coming from a
    software background, and do not realize that in real hardware
    one cannot dynamically create components and then delete
    them.
    Hope that helps.
×
×
  • Create New...