Subject: RE: SDL-News: Operator I defined can't be converted to C
From: Scott Shen (Scott.Shen#holleycomm.com)
Date: Fri Feb 21 2003 - 18:09:47 GMT
Hi all:
Sorry I didn't know my approach is specific to the tool and host that I use.
questions. I need to do real-time (realistic) simulation on my SDL design,
so is there any way in SDL I can know the time unit being used if I switch
tools or host systems? It sounds like that different tool/host will give me
different forms of NOW, in different time unit, when I run a real-time
simulation?
Regards, and thanks for all the comments,
Scott
-----Original Message-----
From: sriram.jatla#telelogic.com [mailto:sriram.jatla#telelogic.com]
Sent: February 20, 2003 11:59 PM
To: daniel.vincent#rd.francetelecom.com; Scott Shen;
lyly97#mails.tsinghua.edu.cn; sdlnews#sdl-forum.org
Subject: RE: SDL-news: Operator I defined can't be converted to C
SDL uses it as a Time Unit and not in the context of seconds. I agree with
Vincent. It is of benefit when one does Discrete-Event simulation where the
transitions are considered from the time perspective as units, whereas in
real-time simulation it is dependent for translation based on the Host
system OS, like Win it would be in sec. When one moves to targetting, it is
then upto the Integrator to decide the ticks/time units translation into
secs/microsecs/......
Best Regards
Sriram
-----Original Message-----
From: VINCENT Daniel FTRD/DTL/LAN
[mailto:daniel.vincent#rd.francetelecom.com]
Sent: Friday, February 21, 2003 1:02 PM
To: Scott Shen; Yang LIU; sdlnews#sdl-forum.org
Subject: RE: SDL-news: Operator I defined can't be converted to C
Sorry Scott, nowhere in Z100 it is said that SDL uses the second as the time
unit.
The time unit is what you decide and the tick if you want.
This is SDL!
Now, maybe you are using some tool that forces the unit to be the second in
order
to have a "realistic" simulation. Then you have the drawbacks that you
mentioned.
-----Message d'origine-----
De : Scott Shen [mailto:Scott.Shen#holleycomm.com]
Envoyé : jeudi 20 février 2003 19:19
À : 'Yang LIU'; sdlnews#sdl-forum.org
Objet : RE: SDL-news: Operator I defined can't be converted to C
Hi Yang:
It looks like you are working on 802.11 or something like that :)
If you doing what I am thinking, here is my comment:
SDL time and timer is very different from the "tick" based timer system used
in embedded systems. In SDL, the time and duration are generally in real
number in units of second, but in embedded system the time and duration are
usually calculated in "ticks" and one tick can be 10ms or 10us, etc. That
is, when you calculate the time or duration in your embedded system you are
actually using integers to count the number of ticks, not SDL time/duration;
and the tick based calculation is really what will happen in your target
system. However, in order to make your design compatible with SDL when you,
for example, SET a timer, you need to translate ticks into SDL
time/duration. The translation is quite simple, you can create a procedure
like this:
Synonym TIMER_TICKS_DURATION Real = 0.01; /* 10ms tick */
fPar
IN num_of_ticks Natural;
RETURNS SDL_duration Duration;
dcl d Duration := 1.0;
SDL_duration := (float (num_of_ticks)*TIMER_TICKS_DURATION) * d
Once your tick is translated into time/duration you can use the results with
SDL timers.
I am not familiar with Tau's code generation though.
Regards,
Scott
-----Original Message-----
From: Yang LIU [ mailto:lyly97#mails.tsinghua.edu.cn
<mailto:lyly97#mails.tsinghua.edu.cn> ]
Sent: February 19, 2003 10:05 PM
To: sdlnews#sdl-forum.org
Subject: SDL-news: Operator I defined can't be converted to C
Become an SDL Forum Society member <
http://www.sdl-forum.org/Society/members.htm
<http://www.sdl-forum.org/Society/members.htm> >
The originator of this message is responsible for its content.
-----From "Yang LIU" <lyly97#mails.tsinghua.edu.cn> to sdlnews -----
I am using Telelogic tau suite 4.3, now I have a problem:
I define a NewType and Operator in SDl like this:
newtype Usec inherits Integer operators all;
adding operators
dUsec : Usec -> Duration;
axioms
for all u in Usec (for all d in Duration( for all r in Real(
r = float(u) ==> dUsec(u) == Duration!(r); )));
endnewtype Usec;
But in generated C file, there have no C code for function dUsec,
my question is :
Is axioms useless in telelogic SDL?
how generate C code of Operator dUsec?
--End text from "Yang LIU" <lyly97#mails.tsinghua.edu.cn> to sdlnews ---
For extra SDL Forum Society benefits join at <
http://www.sdl-forum.org/Society/members.htm
<http://www.sdl-forum.org/Society/members.htm> >
For help, email "majordomo#sdl-forum.org" with the body of your email as:
help
or (iff this does not answer your question) email:
owner-sdlnews#sdl-forum.org
--End text from Scott ShenFrom: sriram.jatla#telelogic.com [mailto:sriram.jatla#telelogic.com]
Sent: February 20, 2003 11:59 PM
To: daniel.vincent#rd.francetelecom.com; Scott Shen; lyly97#mails.tsinghua.edu.cn; sdlnews#sdl-forum.org
Subject: RE: SDL-News: Operator I defined can't be converted to CSDL uses it as a Time Unit and not in the context of seconds. I agree with Vincent. It is of benefit when one does Discrete-Event simulation where the transitions are considered from the time perspective as units, whereas in real-time simulation it is dependent for translation based on the Host system OS, like Win it would be in sec. When one moves to targetting, it is then upto the Integrator to decide the ticks/time units translation into secs/microsecs/......
From: VINCENT Daniel FTRD/DTL/LAN [mailto:daniel.vincent#rd.francetelecom.com]
Sent: Friday, February 21, 2003 1:02 PM
To: Scott Shen; Yang LIU; sdlnews#sdl-forum.org
Subject: RE: SDL-News: Operator I defined can't be converted to CDe : Scott Shen [mailto:Scott.Shen#holleycomm.com]
Envoyé : jeudi 20 février 2003 19:19
À : 'Yang LIU'; sdlnews#sdl-forum.org
Objet : RE: SDL-News: Operator I defined can't be converted to C
mailto:lyly97#mails.tsinghua.edu.cn]
http://www.sdl-forum.org/Society/members.htm>
http://www.sdl-forum.org/Society/members.htm>
This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT