Jump to content

General Understanding


Recommended Posts

Hi,

loosely-timed TLM with temporal decoupling:

i have 2 initiators and a target(memory). Init1 writes to the memory and Init2 reads the memory(Init2 controls and overrides the entries when neccessary).

I want init2 to be notified every time init1 wrote into the memory.

Which possibilities do i have?

Help pls.

Link to comment
Share on other sites

Hi Tanja,

We generally advise that in a loosely timed model it is best if the initiators make sure that code executes according to a defined schedule i.e. the software application running on the initiators should handle locking of shared resources and so on. The intention is that if the model is refined to approximately-timed, or if you put delays in the loosely timed targets, the behaviour of the application should still be correct (though of course the performance may not be good enough).

So I would say that you would have to explicitly synchronize init2 by notifying an event in init1 when init1 writes to memory.

regards

Alan

Link to comment
Share on other sites

Hi Alan,

as advised i declared an event (init1_ev) in a file.h as extern, so that i could use in my files init1.cpp und init2.cpp.

After init1 writes to the memory, it does init1_ev.notify()

In init2 i have following sc_thread, which is sensitive to init1_ev;

init2_thread

{

while (true)

{

wait(init1_ev);

cout << "notification received";

}

}

init2_thread is never triggered. Why?

Thank you.

Link to comment
Share on other sites

If you're going to create synchronization between threads, then I guess the length of the wait doesn't matter, it's only purpose is to allow another thread to run and create a scheduling order in your simulation.

Regarding init3, I'm not sure - if both threads are waiting for the same notification I'm puzzled.

regards

Alan

Link to comment
Share on other sites

Hi,

let's assume:

i have 4 initiators writing to differents parts of a memory(target) through 1 interconnect-component.

i additionnaly have a 5th initiator, which is waiting for notifications from the other initiators to read the new entry in the memory and evaluates it.

Can i pre-define in which order the 4 Writer-initiators are going to acces the memory?

The Reader-initator only have one thread. Can i implement a queue of incoming event-notifications to make sure that he always completes his evaluation before jumping to the next one and to make sure that he acts by respecting the order of incoming notifications? If yes, which is the easiest way to do so?

thank you very much

Link to comment
Share on other sites

I have a model with at least 15 components and i run out of memory at the instatiation of the 5th one! How can i gain memory or what can i do?

This is very hard to tell, without any details about your model or the individual components. Options include

  • Use less memory in your model (and look for memory leaks).
  • Buy more physical memory from your favourite hardware shop.
  • Switch to a 64-bit simulation (assuming you have enough physical memory), since 32-bit processes are usually limited to a 2GB address space.

Do you allocate (very) large memories (i.e. arrays) in your model?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...