Jump to content

Minu

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

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

Minu's Achievements

Member

Member (1/2)

0

Reputation

  1. Hi, I have somehow written code on eda playground Link:https://www.edaplayground.com/x/PPW7 But here the problem is in one cycle if I selected 5th input port then on output port ,the 5 will display. In second cycle if I selected 2th import port then it will display 5 and 2.which is not correct it should be 2 only. This scenario has been asked by one senior. I am unable to find out the exact way how this issue can be resolved.
  2. Ok.Like if we put wait(10,ns) and start with 100 ns then total simulation time will be 110ns but at the time of context switching,many things happen internally so why that time is not reflected in simulation time?
  3. Suppose I have many input ports and one output port on which I want to drive the input port no which was selected.I wrote like this: Vector<sc_port<sc_signal_in_if<bool>>>input_port; Sc_out<int>output_port; After that applied for loop and write I index to output_port. But here the problem is in one cycle if I selected 5th input port then on output port ,the 5 will display.In second cycle if I selected 2th import port then it will display 5 and 2.which is not correct it should be 2 only. So how we can achieve this functionality?
  4. I have a doubt regarding context switching consuming timing.Is it counted in simulation time?
  5. Thanks @tmp_sc for answering my question.But when I did as you suggested it is coming to else part. One more thing ,like at 256*20 ns interrupt will enable . I want to disable interrupt after 20ns also.How this can be achieved in SC_METHOD?
  6. Hi All, I am trying to schedule interrupt of timer for next time as my current logic only executed interrupt only one time. 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"; } } And in SC_CTOR i am registering this process SC_METHOD(call_overflow_interrupt); sensitive<<Event; dont_initialize(); Event.notify(256*20,SC_NS);//count=256(0xFF),clock period=20ns I wrote above code but it is not scheduling the process for next time.How this can be achieved?
  7. I am beginner in SystemC and wants to learn concept of loosely timed implementation on my timer code. I got some idea on LT but unable to implement following functionalities . How can I apply following functionalities in my code Timer model should not have pin for clock and there should be some provision through which clock interval can be provided to timer model. Either it can be a constructor argument or may add an API. Timer should not count/increment at every clock edge, rather we should apply mathematical formulas to calculate when the interrupts will be generated. Please help me out. My code link:https://www.edaplayground.com/x/Dqz
  8. Hi @David Black, Thanks for answering my question. This I have implemented earlier but in this way I am not getting correct out. MY testbench input is @0ns a=0 b=0. Out=0 @5ns a=5. b=0. Out=5 @8ns a=5. b=10 out=15 @15ns a=7. b=7 out=14 And I should get output after 2ns so the output will be appear at @0ns a=0 b=0. Out=0 @7ns a=5. b=0. Out=5 @10ns a=5. b=10 out=15 @17ns a=7. b=7 out=14 Above code is not fulfilling this requirement. It would be great if you provide some insights on this requirement.
  9. I am beginner in SystemC. I have implemented add() function using SC_THREAD(while loop and wait()).I am printing output on log after 2ns.How can I achieve this using SC_METHOD and next_trigger? Code link using SC_THREAD:https://www.edaplayground.com/x/JSU8 Code link using SC_METHOD: https://www.edaplayground.com/x/wsBv Please help I am stuck over this.
×
×
  • Create New...