Jump to content

mohitnegi

Members
  • Content Count

    99
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by mohitnegi

  1. hi Stephan/Alan, so guys any work around for using c++14 with systemC without " error std::gets is not declared using std::gets" . Thanks
  2. hi , I have updated my gcc compiler to 4.9 version . now when I compile my system C model with g++14 compiler option enabled ,it is giving this error in systemC header file systemc.h 118:16 error std::gets is not declared using std::gets I was not getting this error earlier . I tried building my systemC library with ./configure CXX=g++-4.9 but the same issue comes up .. can anyone help in this ??
  3. Hello guys, well with systemC modelling appoarch is becoming more accurate in recent times .. I wish to discuss here that why do we need to go for synthesizable systemC ... why can't we just replace systemC models in our existing hardware by just an SW update and in area where we can little bit compromise in performance ... thanks guys ...
  4. I have a virtual platform(versatilepb based) which I am using to validate my Universal flash subsystem(UFS) host controller TLM model. From OS, when it issue SCSI command, the underlying ufshcd driver make a data packet and put in in system memory. The system memory is allocated using dmam_alloc_coherent. The driver also write the starting address of this memory in UFS host controller register. You can see this driver in linux-3.17.2/drivers/scsi/ufs Now when in TLM model I read that register, I get the correct address bus when I try to access this address as uint8_t data1 = *( uint8_t *) (address); I am getting segmentation fault. My question is can I directly access system memory address in TLM model as I am doing above or I need to do something special. Thanks
  5. hello , I have a virtual platform(versatilepb based) which I am using to validate my Universal flash subsystem(UFS) host controller TLM model. From OS, when it issue SCSI command, the underlying ufshcd driver make a data packet and put in in system memory. The system memory is allocated using dmam_alloc_coherent. The driver also write the starting address of this memory in UFS host controller register. You can see this driver in linux-3.17.2/drivers/scsi/ufs Now when in TLM model I read that register, I get the correct address bus when I try to access this address as uint8_t data1 = *( uint8_t *) (address); I am getting segmentation fault. My question is can I directly access system memory address in TLM model as I am doing above or I need to do something special. Thanks
  6. hello , thanks for then reply ... could you tell OS related commands to drive SCSI commands ...
  7. Hello guys , i am into development of UFS(Universal Flash Storage) which follows SCSI based commands ....Now i have developed its model and wish to verify this model with device driver available in linux kernal now as i have already mentioned this is SCSI based(protocol similar to USB) ... Now how do i drive this SCSI based driver from the terminal ..should i call the SCSI commands or device driver ... the problem is a general device driver verification problem but i could't find it solution on net ... i know this problem is not related to this forum but can someone guide me who have done it earlier ...
  8. well Karthik welcome to the group -- you can find a lot books on these topics which are easy to understand with prior knowledge of modelling language (ill PM you if u cannot find) regarding projects you can start with peripheral IPs like USART ,SPI ,I2C ,etc
  9. pseudo code as- Module 1 -> module 2 (TM connection) in module 1 { thread1();{ taking data X from qeueu 1 } thread 2();{ taking data Y from qeueu 2 } } module 2 { btransport (){ if queue 1 is empty then wait else read data from queue 1 } } note 1 - queue 1 is filled from thread in module 2 contains data for both thread1 and thread 2 now the issue is at some stage both thread 1 and thread 2 are waiting for data to be written on queue1 ... now as soon as data is written on queue 1 i want to control which thread to trigger from module 1 as order of data is not fixed .. any solution suggested here ...
  10. Hello , i have a scenario where there is tlm scokets btw two module Module 1 have two threads A & B running independently and module 2 has single thread C now i problem is thread1 is activated first(assume) and after some transaction waits in b_transport , by wait here i mean some qeue is there which is updated by thread C .now thread B becomes active and call b_transport which brings the thread A out of wait (it doesnt suppose to happen as it qeue is not updated) and produce unwanted result ... how to control this ...right now i am using a while loop in wait qeue for thread A so that it keep on waiting (it is working) but not sure whether it is the right appoarch .... hope u understand ...pls help
  11. Hello guyz , i am getting this error on a particular notification below is the stack Program received signal SIGBUS, Bus error. 0x00007ffff7d0317e in sc_core::sc_event::notify(sc_core::sc_time const&) () from /usr/local/systemc-2.3.1/lib-linux64/libsystemc-2.3.1.so (gdb) backtrace #0 0x00007ffff7d0317e in sc_core::sc_event::notify(sc_core::sc_time const&) () from /usr/local/systemc-2.3.1/lib-linux64/libsystemc-2.3.1.so #1 0x00000000004225c2 in logical_unit<unsigned int, 32u>::response (this=0x6f5220, task_comand=33 '!', rsponse=0 '\000', lun1=2 '\002', t_tag=17 '\021') at /home/mic-24/Desktop/qemu+other/ufs_dropbox_21/include/logical_unit.tpp:1314 #2 0x0000000000429d44 in logical_unit<unsigned int, 32u>::lu1_data_in (this=0x6f5220, current_cmd=..., opcode_current_cmd=8 '\b', lu_resent_data=0 '\000', lun_ftl=1 '\001') at /home/mic-24/Desktop/qemu+other/ufs_dropbox_21/include/logical_unit.tpp:458 #3 0x0000000000424028 in logical_unit<unsigned int, 32u>::command_processing (this=0x6f5220, lu_resent_data=0 '\000', lun_ftl=1 '\001') at /home/mic-24/Desktop/qemu+other/ufs_dropbox_21/include/logical_unit.tpp:199 #4 0x000000000041bd22 in logical_unit<unsigned int, 32u>::logical_unit_thread (this=0x6f5220) at /home/mic-24/Desktop/qemu+other/ufs_dropbox_21/include/logical_unit.tpp:37 #5 0x0000000000416979 in device<unsigned int, 32u>::logical_unit_trans (this=0x6dce00) at /home/mic-24/Desktop/qemu+other/ufs_dropbox_21/include/device.tpp:315 #6 0x00007ffff7d1dde6 in sc_core::sc_thread_cor_fn(void*) () from /usr/local/systemc-2.3.1/lib-linux64/libsystemc-2.3.1.so #7 0x00007ffff7d0248b in sc_core::sc_cor_pthread::invoke_module_method(void*) () from /usr/local/systemc-2.3.1/lib-linux64/libsystemc-2.3.1.so #8 0x0000003362a079d1 in start_thread () from /lib64/libpthread.so.0 #9 0x00000033626e886d in clone () from /lib64/libc.so.6 (gdb)
  12. Hello guyz i have some issue related to this #include "systemc.h" class test : public sc_module { public : sc_event_queue events; SC_HAS_PROCESS(test); test(sc_module_name name){ SC_THREAD(thread1); SC_THREAD(thread2); } void thread1(){ //wait(event_1); events.notify(SC_ZERO_TIME); events.notify(SC_ZERO_TIME); } void thread2(){ while(1){ wait(events.default_event()); cout<<"event arrived"<<endl; } } }; Now this is printing " event arrived " twice ... Now but in actual there is also a wait (commented part) in code ... now when i am actualling implementing it , it is running only once ...i dont understand the reason for this ......
  13. Hello ,i have a scenario like this thread1 {while(1) e1.notify(); } thread2{ while(1){ wait(e1); } } know thread 1 leaves control after two loop i.e after two event notify now i want thread2 to also run twice ... can use sc_event_and_list here ???will this fullfill my purpose ...
  14. hello , I have a problem here where i am using wait(e1||e2) now when it comes out of this wait statement i have to perform some functionality when e1 is triggerred and some functionality when e2 triggered ... thnaks ...
  15. #include "systemc.h" class test : public sc_module { public : sc_process_handle t ; SC_HAS_PROCESS(test); test(sc_module_name){ SC_THREAD(run); t = sc_get_current_process_handle(); SC_THREAD(run2); } void run(){ wait(10,SC_NS); wait(5,SC_NS); cout<<"T :run2 "<<sc_time_stamp().value()<<endl; } void run2(){ wait(10,SC_NS); t.suspend(); wait(20,SC_NS); t.resume(); //t.reset(); } }; int sc_main(int, char**){ test t("test"); sc_start(); return 0; } vs #include "systemc.h" class test : public sc_module { public : //sc_process_handle t ; sc_event e1,e2; SC_HAS_PROCESS(test); test(sc_module_name){ SC_THREAD(run); //t = sc_get_current_process_handle(); SC_THREAD(run2); } void run(){ wait(10,SC_NS); wait(5,SC_NS); e1.notify(); //here we want to suspend it wait(SC_ZERO_TIME); wait(e2); ///here it will resume cout<<"T :run2 "<<sc_time_stamp().value()<<endl; } void run2(){ wait(10,SC_NS); wait(e1); //t.suspend(); wait(20,SC_NS); e2.notify(); //t.resume(); //t.reset(); } }; int sc_main(int, char**){ test t("test"); sc_start(); return 0; } our purpose is same in both cases ...so what is the difference whether i use wait(e) or suspend/resume
  16. for suspend/resume #include "systemc.h" class test : public sc_module { public : sc_process_handle t ; SC_HAS_PROCESS(test); test(sc_module_name){ SC_THREAD(run); t = sc_get_current_process_handle(); SC_THREAD(run2); } void run(){ wait(10,SC_NS); cout<<"T :run1 "<<sc_time_stamp().value()<<endl; wait(5,SC_NS); cout<<"T :run2 "<<sc_time_stamp().value()<<endl; } void run2(){ wait(10,SC_NS); cout<<"T :run3 "<<sc_time_stamp().value()<<endl; t.suspend(); //t.disable(); cout<<"T :run4 "<<sc_time_stamp().value()<<endl; wait(20,SC_NS); cout<<"T :run5 "<<sc_time_stamp().value()<<endl; t.resume(); //t.enable(); cout<<"T :run6 "<<sc_time_stamp().value()<<endl; //t.reset(); } }; int sc_main(int, char**){ test t("test"); sc_start(); return 0; } mic-24@localhost tmp]$ ./run.x SystemC 2.3.1-Accellera --- May 1 2014 15:38:34 Copyright (c) 1996-2014 by all Contributors, ALL RIGHTS RESERVED T :run1 10000 T :run3 10000 T :run4 10000 T :run5 30000 T :run6 30000 T :run2 30000 here i dont understand why final value is 30000 not 35000 and what happenened to this "wait(5,SC_NS);" now in disable/resume #include "systemc.h" class test : public sc_module { public : sc_process_handle t ; SC_HAS_PROCESS(test); test(sc_module_name){ SC_THREAD(run); t = sc_get_current_process_handle(); SC_THREAD(run2); } void run(){ wait(10,SC_NS); cout<<"T :run1 "<<sc_time_stamp().value()<<endl; wait(5,SC_NS); cout<<"T :run2 "<<sc_time_stamp().value()<<endl; } void run2(){ wait(10,SC_NS); cout<<"T :run3 "<<sc_time_stamp().value()<<endl; //t.suspend(); t.disable(); cout<<"T :run4 "<<sc_time_stamp().value()<<endl; wait(20,SC_NS); cout<<"T :run5 "<<sc_time_stamp().value()<<endl; //t.resume(); t.enable(); cout<<"T :run6 "<<sc_time_stamp().value()<<endl; //t.reset(); } }; int sc_main(int, char**){ test t("test"); sc_start(); return 0; } [mic-24@localhost tmp]$ ./run.x SystemC 2.3.1-Accellera --- May 1 2014 15:38:34 Copyright (c) 1996-2014 by all Contributors, ALL RIGHTS RESERVED T :run1 10000 T :run3 10000 Error: (E559) Undefined process control interaction: attempt to disable a thread with timeout wait: test.run In file: ../../../../src/sysc/kernel/sc_process.cpp:345 In process: test.run2 @ 10 ns [mic-24@localhost tmp]$ what is the problem here ???
  17. hello all , i am just started to use sc_process_handler and the suspend/wait usuage is somewhat similar to wait(e) (ignoring its implementation w.r.t schedular) ... as i see that from the usuage point of view i can replace suspend/resume any where i have wait(e) ... can anyone tell me the difference here ...
  18. hello , i wish to store sc_time_stamp() value in some local variable , i am trying to store it in uint32_t ...but it is giving the following error .. error: cannot convert ‘const sc_core::sc_time’ to ‘uint32_t’ in initialization how to store this value ?/?
  19. but using address as a unique identifier(i guess by switching on basis of address inside b_transport) , how will i produce two transaction at same time ....??
  20. thanks for the reply ... well how to manage the b_transport implementation in target socket in case of two trans objects ????
  21. thanks David for the detailed response ... but could you give a simpler to my question as i have some difficulty in relating this answer with my question... and another thing is it advisable to use e.notify(SC_ZERO_TIME) as far as possible ...
  22. my issue is - i am calling b_transport from my initiator which is writing a register in target model ...a process in target model is waiting for the event which is generated when that register is written ...then there is wait(SC_ZERO_TIME) which is sync the initiator thread and target thread... Now when i have e.notify() in register the target process is starting immediately but when i am using e.notify(SC_ZERO_TIME) [which is usually recommended ] the target process is not starting immediately but after in next evaluation phase which i check by applying two wait(SC_ZERO_TIME) ... What is the reason for such behavior ???
  23. hello , i have a scenario where i i have an initiator generating transactions and target receiving it and a model working on that transaction ... now this model will process only one transaction at a time and reject others , now i need to check this functionality so i wish to transmitted to transmit two transaction at same time how can that be possible as it is a LT model .. and things woud be executed at zero simulation time ... right now inside the model i am using wait and i am transferring to transaction one after another but not sure whether this is the right approach ... can anyone suggest me a solution for this ???
  24. well in the initiator thread i am doing this1.write(some register X)2.allocate local mem and parallelly a process(or thread) in target is waiting for something to be written on x and it becomes active i.e print M3.then i am transferring this mem through DMI Now at console at run time i am expecting the dmi transfer but receving the receiving M(from target process) This is happening as soon as initiator call wait(delay) (for dmi ) but M is printed ?? How to solve this synchronization issue ??
×
×
  • Create New...