Project

General

Profile

Actions

Bug #1260

open

Some model comments for 39_7 are implemented incorrectly

Added by Evgeny Novikov about 13 years ago. Updated about 13 years ago.

Status:
Open
Priority:
Normal
Assignee:
Category:
Rules and Models
Start date:
05/20/2011
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

As it was noticed by Alexey there are a lot of warnings concerned with 39_7 model comments:

error-trace-visualizer: WARNING: Incorrect format of the model comment ' /* LDV_COMMENT_ASSERT Lock should be in a free tate*/\'.
error-trace-visualizer: WARNING: Incorrect format of the model comment ' /* LDV_COMMENT_CHANGE_STATE Goto locked state*/\'
...

So first of all when somebody implement a model see on error trace visualizer log please! Sometimes it says something useful like in this case. In particular these messages are arisen due to '\' at the end of line that comes from their macro nature:
#define __ldv_spin_lock() \ 
 do {\ 
 /* LDV_COMMENT_ASSERT Lock should be in a free state*/\ 
 ldv_assert(ldv_lock_TEMPLATE==1);\ 
 ...

Unfortunately we haven't much experience in model comments creating and thus may think that they will work in using macros. But this isn't the case! Because if you'll see in error trace you'll find out that all constructions obtained from model macro expansion point out to the same line in source code that in turn doesn't related with macro model comment lines at all.
So if you want to use model comments do not put them inside macros! I will add this rule to our model design guide. But 39_7 model should be fixed a bit nevertheless. I propose that macros should be replaced with corresponding functions.
Moreover since model comments don't work we cannot put this model to the 4th level ;)

Actions #1

Updated by Evgeny Novikov about 13 years ago

Oh! The similar issue is with blast_assert that also comes from macro! That's why you can see incorrect model comment for this function.

Actions #2

Updated by Evgeny Novikov about 13 years ago

I think, that we cannot use '\' with model comments since every particular model comment should be related just with one line in program source code (in model in our case).

Actions #3

Updated by Vadim Mutilin about 13 years ago

Eugene Novikov wrote:

So if you want to use model comments do not put them inside macros! I will add this rule to our model design guide. But 39_7 model should be fixed a bit nevertheless. I propose that macros should be replaced with corresponding functions.

It is not possible, because for this model we need rerouter which can
replace template variables (ldv_lock) only in the first level functions
(the functions which are rerouted), but not deeper.

Actions #4

Updated by Vadim Mutilin about 13 years ago

Eugene Novikov wrote:

I think, that we cannot use '\' with model comments since every particular model comment should be related just with one line in program source code (in model in our case).

I think we should support model comments inside lines, not just per one line.

Actions #5

Updated by Evgeny Novikov about 13 years ago

  • Status changed from New to Open
  • Priority changed from High to Normal

After discussion we decided that there is no appropriate way at the moment to overcome this issue. So let's wait for aspectator rerouter.

Actions

Also available in: Atom PDF