Jump to content

tmp_sc

Members
  • Posts

    15
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tmp_sc's Achievements

Member

Member (1/2)

1

Reputation

  1. Hi Eyck, thank you for the hint. Other processes may or may not write to the queue every cycle. Do you have in mind some mechanism which I could use to be sure that send_m is called when all of those who (potentially) write to the queue have written?
  2. Hi! I need a help with SystemC processes. If I have the design with several SC_THREADs/METHODs which are sensitive to the clk.posedge_event() (some of them are using non blocking transport), is there a way that we ensure one SC_METHOD to be scheduled "last" among them? All other threads should put some data to the queue, and then SEND thread should send it. Would this approach (with wait(SC_ZERO_TIME)) help? void send_m() { // should be called last wait(clk.posedge_event()); wait(SC_ZERO_TIME); // send things from the queue }
  3. Have you tried using combination of sc_event (or sc_event_queue) and sc_signals ? Not sure I completely understood the usecase, but between modules you could use sc_signal and inside module sc_event for sync
  4. In the meantime I figured out: Setting sc_biguint via get_raw pointer is not visible immediately because sc_uint (base class for sc_biguint) has several members. In this case most important ones are private: small_type sgn; // Shortened as s. ... sc_digit *digit; // Shortened as d. if we access through get_raw method sc_digit* get_raw() const { return digit; } we will update only digit, but not sgn . In case we want to print out the value of sc_biguint, at some moment we will call bool sc_unsigned::iszero() const { if (sgn == SC_ZERO) return true; So without updating the sgn, we will get the value 0 even though digit is changed
  5. Hi, I want to set the value of `sc_biguint<128>` with `get_raw` method. If the value is just initialized to 0, I cannot do it. E.g. sc_biguint<128> val{0x00}; cout << hex << val << endl; auto* ptr = val.get_raw(); *ptr = 0x2AAABBBB; cout << hex << val << endl; output is 000000000000000000000000000000000 000000000000000000000000000000000 but in case it had some arithmetic operations, I can. E.g. sc_biguint<128> val{0x00}; val += 0xABCDEF0912345678; <--- difference cout << hex << val << endl; auto* ptr = val.get_raw(); *ptr = 0x2AAABBBB; cout << hex << val << endl; and the output is 00000000000000000abcdef0912345678 00000000000000000abcdef092aaabbbb <--- value is changed Any idea what is the reason for this feature?
  6. Hi, I have a SystemC driver model which is connected to TLM memory module (AT style). I wanted to have scripting API feature of the model, in order e.g. to test memory read/write. Script should look like write(0x500, 0xABAB) // wait until write is done, or some fixed amount of time (D) var x = read(0x500) // wait memory read delay or D if (x != 0xABAB) { throw error; // or smth else } I checked duktape and C++ version (dukglue), but I don't know how to deal with timing/delays (script can be evaluated immediately, I don't know how to wait for some time time until the read/write is done or some fixed amount of time). Anyone had some similar problem, could you share your findings, or give some suggestions? Scripting language is not fixed.
  7. How exactly did you mean? template<typename T> bool expect(const sc_in<T>&input, const T& expectedVal) This would work for bool, but not for sc_uint<> data types
  8. Hi all, I am trying to write some template test function, to compare read sc_in value vs expected one. Something like template<typename T> bool expect(const sc_in<T>&input, const uint32_t& expectedVal) { return (input.read() == expectedVal); } instead of const uint32_t& (and needing to overload for e.g. bool), how can I get "underlying" data type of sc_in ? I am using C++14 compiler. Thank you
  9. SC_METHOD is like a cpp function, you need explicitly to trigger it's sensitivity list (in this case to notify Event again), otherwise it won't be re-entered. E.g. void call_overflow_interrupt(){ //check overflow //cout<<"\nIn callInterrupts func\n"; if((timer_cntrl &(1<<TIMER_CNTRL_OV))&& timer_val==0xff) { intr1=1; timer_intr_status=ENABLE(timer_intr_status,TIMER_OV_INTR); } else{ cout<<"\ncall_overflow_interrupt is not coming\n"; } // Added this line to trigger SC_METHOD's sensitivity Event.notify(256*20,SC_NS);//count=256(0xFF),clock period=20ns }
  10. Hi, I have run msan checks (compiled with -g -fsanitize=memory , I am using Clang14 with -Os) and I have got the following Warning: ==26683==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x1d32b2b in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/basic_string.h:673:6 #1 0x1d32b2b in void std::__new_allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::construct<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/new_allocator.h:175:23 #2 0x1d32b2b in void std::allocator_traits<std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::construct<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/alloc_traits.h:516:8 #3 0x1d32b2b in void std::__relocate_object_a<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/stl_uninitialized.h:1064:7 #4 0x1d32b2b in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* std::__relocate_a_1<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/stl_uninitialized.h:1092:2 #5 0x1d32b2b in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* std::__relocate_a<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/stl_uninitialized.h:1133:14 #6 0x1d32b2b in std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_S_do_relocate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, std::integral_constant<bool, true>) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/stl_vector.h:490:9 #7 0x1d326b3 in std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_S_relocate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/stl_vector.h:507:9 #8 0x1d326b3 in void std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_realloc_insert<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/vector.tcc:474:23 #9 0x36cf5c2 in tlm::tlm_phase::tlm_phase(std::type_info const&, char const*) #10 0x1c9699e in axi::tlm_phase_BEGIN_PARTIAL_REQ::tlm_phase_BEGIN_PARTIAL_REQ() First line, where it starts to complain is DECLARE_EXTENDED_PHASE(BEGIN_PARTIAL_REQ); DECLARE_EXTENDED_PHASE(END_PARTIAL_REQ); DECLARE_EXTENDED_PHASE(BEGIN_PARTIAL_RESP); DECLARE_EXTENDED_PHASE(END_PARTIAL_RESP); DECLARE_EXTENDED_PHASE(ACK); Is this a know issue with SystemC macro DECLARE_EXTENDED_PHASE, or something else? Any suggestion how I can disable the warning in this particular case? Thanks
  11. Hi maehne, Philipp, If we intent to use Valgrind, should we also configure SystemC library build with --enable-debug ?
  12. Hi David, Thanks a lot! 'autoreconf -i' followed by 'autoupdate' fixed the issue. Maybe this can be written in "INSTALL.md"? Out of this topic: Latest branch on Github is SystemC 2.3.4, right? Any big differences w.r.t. 2.3.3? Didn't find anything big mentioned in release notes Regards
  13. Hi, I tried to clone official SystemC repo from Accelera website and follow installation steps. After cloning and running autoconf I get the following error: configure.ac:58: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete. configure.ac:58: You should run autoupdate. ./lib/autoconf/general.m4:2081: AC_CANONICAL_SYSTEM is expanded from... configure.ac:58: the top level configure.ac:565: warning: AC_OUTPUT should be used without arguments. configure.ac:565: You should run autoupdate. configure.ac:59: error: possibly undefined macro: AM_INIT_AUTOMAKE If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:117: error: possibly undefined macro: AM_PROG_AS configure.ac:270: error: possibly undefined macro: AC_PROG_LIBTOOL configure.ac:336: error: possibly undefined macro: AM_CONDITIONAL configure.ac:529: error: possibly undefined macro: AC_CHECK_DEFINE After running autoupdate (which finished w/o any message), I cannot configure, I get the error ../configure configure: error: cannot find required auxiliary files: install-sh And if I try to run autoconfig after autoupdate I get the similar error like before: If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.ac:112: error: possibly undefined macro: AM_PROG_AS configure.ac:265: error: possibly undefined macro: AC_PROG_LIBTOOL configure.ac:331: error: possibly undefined macro: AM_CONDITIONAL configure.ac:524: error: possibly undefined macro: AC_CHECK_DEFINE Any hints on how can I fix this? Regards
  14. You are right, usecase is very important. But my question was focused only on simulation speed of some bigger design, w/o taking into account the precision (which we will definitely get with AT models). If I am not wrong, we have 2 choices (1) AT models which can be implemented with SC_METHOD (which are faster than SC_THREAD) vs (2) LT models which need to be implemented with SC_THREADs? Solution (2) will be faster, if we can minimize context switches. But what can we use in order to minimize it? Temporal decoupling, DMI and events in stead of toggling clock?
  15. Hi David, regarding simulation speed: Since SC_THREAD needs to use wait(), which techniques is possible to use in order to minimize context switch? Only temporal decoupling?
×
×
  • Create New...