Jump to content

jcmel

Members
  • Content count

    11
  • Joined

  • Last visited

About jcmel

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location
    France
  1. sc_port binding problem

    Hi Ralph, For the definition of SC_HAS_PROCESS macro, I followed the recommended style defined in SystemC: From the Ground up illustrated in figure 4.20: Recommended style NAME.cpp page 57. I believe I dont' have the permission to provide a pdf of this page. I'am right. Regards, Jean-Claude
  2. sc_port binding problem

    Hi, Here is a part of the code. Regards, Jean-Claude class M2 : public sc_module { public: // Constructor M2(sc_module_name name); // Destructor ~M2(); sc_port<sc_fifo_in_if< Schedule> > p0; private: void threadReceiveSchedule(); .... }; SC_HAS_PROCESS(M2); M2::M2(sc_module_name name) { SC_THREAD(threadReceiveSchedule); } void M2::threadReceiveSchedule() { Schedule schedule; while(true) { if (p0->nb_read(schedule)) { // DO something } wait(10, SC_NS); } } ////////////////////////////////////////// class M1 : public sc_module { public: // Constructor M1(sc_module_name name); // Destructor ~M1(); sc_fifo<schedule > > c0; private: M2* _m2; .... }; SC_HAS_PROCESS(M1); M1::M1(sc_module_name name): c0("fifo_schedule", 10) { _m2 = new M2("M2"); // binding _m2->p0(c0); } void M1::process() { .... c0.write(schedule); }
  3. Hi everybody, I would like to implement a communication between a process (P1) and another process P2 inside an instance (m2) through a fifo of schedule. At compilation it looks well but at run time i am facing a problem of binding failed (port p0 not bound). I don't understand the error (E109) because in constructor of m1, I did the binding m2->p0(c0). Thanks for your help. regards Jean-Claude
  4. Usage of Sc_event_or_list

    Hi, I am wondering if it's possible to clear a sc_event_or_list before adding the sc_event in the loop. In the class reference I don't see a method to do this. regards Jean-Claude
  5. Usage of Sc_event_or_list

    Hi Philip, I am agree with you, the name is not well chosen. I read many threads on the subject but I don't find any solution. In the thread above, it is proposed to use instead sc_signal<bool> which has an event() method but I don't know how. I need to trigger the signal at a specific time like an event. Thanks. Jean-Claude
  6. Hello everybody, I try to use an sc_event_or_list object to catch multiple events but I don't know how to identify the event which occurs. the idea is to schedule the transmission of commands at a specific time After the wait(_allEvents) I would like to test that event changed. Thanks in advance for your help. Jean-Claude Here is a part of the code: class Scheduler : public sc_module { public: // Constructor Scheduler(sc_module_name name); // Destructor ~Scheduler(); // Methods void setSchedule(const T_SCHEDULE& schedule); void setDebug(bool debug) { _isDebug = debug; } void start(); void setTimeSynchro(); // Spawn Thread void threadReceiveEvents(); private: static const int _MAX_EVTS; bool _isDebug; sc_vector<sc_event> _evts; T_SCHEDULE _schedule; sc_event_or_list _allEvents; sc_time _startTime; }; const int Scheduler::_MAX_EVTS = 10; SC_HAS_PROCESS(Scheduler); Scheduler::Scheduler(sc_module_name name): sc_module(name), _isDebug(false), _evts("scheduler_evts", _MAX_EVTS) {} Scheduler::~Scheduler() {} void Scheduler::setSchedule(const T_SCHEDULE& schedule) { if (_isDebug) { std::cout << sc_time_stamp() << "\tScheduler::setSchedule" << std::endl; for (unsigned int i = 0; i< schedule.size(); i++) { Command* cmd = schedule; cmd->display(); } } _schedule = schedule; // Associate event to each command for (unsigned int i = 0; i< _schedule.size(); i++) { _allEvents |= _evts; } // Spawn process sc_process_handle handle = sc_spawn( sc_bind(&Scheduler::threadReceiveEvents, this) ); } void Scheduler::start() { if (_isDebug) { std::cout << sc_time_stamp() << "\tScheduler::start >>> notify Events..." << std::endl; } for (unsigned int i = 0; i< _schedule.size(); i++) { Command* cmd = _schedule; double time = cmd->getTime(); sc_time_unit timeUnit = cmd->getUnit(); _evts.notify(time, timeUnit); } } void Scheduler::setTimeSynchro() { if (_isDebug) { std::cout << sc_time_stamp() << "\tScheduler::setTimeSynchro" << std::endl; } // Observe current time sc_time now(sc_time_stamp()); _startTime = now; } void Scheduler::threadReceiveEvents() { if (_isDebug) { std::cout << sc_time_stamp() << "\tScheduler::threadReceiveEvents() spawned..." << std::endl; } while (true) { wait(_allEvents); std::cout << sc_time_stamp() << "\tScheduler::threadReceiveEvents() >>> Event received at " << sc_time_stamp() - _startTime << " from " << _startTime << std::endl; } }
  7. Hi Ralph, Finally I decided to use SystemC with Microsoft Visual Studio 2010 (version 32bits) on Win7. I made a Dynamic Link Library from systemc-2.3.1 source code and it works. Regards, Jean-Claude
  8. Hello, I ran dos2unix to all systemc directory but the problem is the same. Regards, Jean-Claude
  9. Hello everybody, I followed the steps below to install systemc-2.3.1 on Windows 7 (64bits) : I start a cygwin batch and create a objdir directory In this directory I configure the package with ../configure And I have an error at ./config.status creation. ?? I have attached conf.lo and config.status file $ ../configure checking build system type... i686-pc-cygwin checking host system type... i686-pc-cygwin checking target system type... i686-pc-cygwin checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking how to create a pax tar archive... gnutar checking whether make supports nested variables... yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking for gcc... g++ checking whether we are using the GNU C compiler... yes checking whether g++ accepts -g... yes checking for g++ option to accept ISO C89... unsupported checking dependency style of g++... gcc3 checking dependency style of g++... gcc3 checking whether ln -s works... yes checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... no checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by g++... /usr/i686-pc-cygwin/bin/ld.exe checking if the linker (/usr/i686-pc-cygwin/bin/ld.exe) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -config.status.txtconfig.log.txt interface... BSD nm checking the maximum length of command line arguments... 8192 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert i686-pc-cygwin file names to i686-pc-cygwin format... func_convert_file_noop checking how to convert i686-pc-cygwin file names to toolchain format... func_convert_file_noop checking for /usr/i686-pc-cygwin/bin/ld.exe option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL checking for dlltool... dlltool checking how to associate runtime and link libraries... func_cygming_dll_for_implib checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from g++ object... ok checking for sysroot... no checking for mt... no checking if : is a manifest tool... no checking how to run the C preprocessor... g++ -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if g++ supports -fno-rtti -fno-exceptions... yes checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/i686-pc-cygwin/bin/ld.exe) supports shared libraries... yes checking whether -lc should be explicitly linked in... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/i686-pc-cygwin/bin/ld.exe checking if the linker (/usr/i686-pc-cygwin/bin/ld.exe) is GNU ld... yes checking whether the g++ linker (/usr/i686-pc-cygwin/bin/ld.exe) supports shared libraries... yes checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/i686-pc-cygwin/bin/ld.exe) supports shared libraries... yes checking dynamic linker characteristics... Win32 ld.exe checking how to hardcode library paths into programs... immediate checking for SystemC install layout... ignored checking for SystemC library arch suffix... default (TARGET_ARCH=cygwin) checking whether to add debug symbols to the SystemC library... no checking whether to enable compiler optimization... yes checking whether to add support for asynchronous update requests... yes checking whether to use POSIX threads for SystemC processes... no checking whether to enable simulation phase callbacks (experimental)... no checking for SC_DISABLE_VIRTUAL_BIND defined... no checking for SC_ENABLE_IMMEDIATE_SELF_NOTIFICATION defined... no checking for SC_ENABLE_EARLY_MAXTIME_CREATION defined... no configure: creating ./config.status ./config.status: line 766: e-quote: command not found ./config.status: line 767: syntax error near unexpected token `do' ./config.status: line 767: `ds old_archive_from_new_cmds old_archive_from_expsyms_cmds archive_cmds archive_expsym_cmds module_cmds module_expsym_cmds export_symbols_cmds prelink_cmds postlink_cmds postinstall_cmds postuninstall_cmds finish_cmds sys_lib_search_path_spec sys_lib_dlsearch_path_spec reload_cmds_CXX old_archive_cmds_CXX old_archive_from_new_cmds_CXX old_archive_from_expsyms_cmds_CXX archive_cmds_CXX archive_expsym_cmds_CXX module_cmds_CXX module_expsym_cmds_CXX export_symbols_cmds_CXX prelink_cmds_CXX postlink_cmds_CXX; do' Thanks in advance for your help. Regards, Jean-Claude
  10. Problem with multiport usage

    Hello, Thanks for your response, I tried this way and it works. Best regards, Jean-Claude
  11. Hi, I have 2 modules: one Test Bench (TB) and a Device under Test (DUT). The TB has an output port (p_out) to simulate a power on (bool). The DUT has an input multiport (p_in) and inside the DUT there are many modules M with one input port (x_in) connected to (p_in). The idea is to simulate a power on througn TB that is distributed to all internal modules of DUT. Here are the declarations: in TB : sc_out<bool> p_out; In internal moules of DUT: sc_in<bool> x_in; In DUT: sc_port< sc_signal_in_if<bool> , 10, SC_ZERO_OR_MORE_BOUND> p_in; Each time I create an internal modules of DUT, I create automatically a channel of type sc_signal <bool> sig, that I connect between p_in and x_in by doing : sc_signal <bool>* sig = new sc_signal <bool> (); p_in(*sig); x_in(*sig); in main program : sc_signal < bool> sig_power_on; tb->p_out(sig_power_on); I try to connect the signal to the input multiport p_in by : p_in(sig_power_on); But I have the error port cannot be used as a function. Perhaps I don't use the multiport as it would be. Please have you got an idea. Regards
×