Jump to content

TLM driver model with scripting API

Recommended Posts


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.

Link to comment
Share on other sites

AFAIK there is nothing out-of-the-box. Basically you need to embedd an interpreter and provide it with some function to be called by the script. Easy to embed would be Lua, Python or Tcl. In all these cases you need to write the code to integrate the interpreter with the SC kernel. Since SystemC is C++ this is not overly complicated (done that several times)

For Python the is another option: use PySysC to construct and run your model. It allows to execute Python code as part of the model. Latest updates you may find here as it is under active development.

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.

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...