Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

cell is initialized with .Set instead of .Map #2351

Open
kheradmand opened this issue Oct 21, 2017 · 0 comments
Open

cell is initialized with .Set instead of .Map #2351

kheradmand opened this issue Oct 21, 2017 · 0 comments

Comments

@kheradmand
Copy link
Contributor

kheradmand commented Oct 21, 2017

I have a configuration that contains the following cells:

   ...
    <statefuls>
        <stateful multiplicity="*">
            <stype> .K </stype>
            <name> .K </name>
            <opts> .Map </opts>
            <vals> .Map </vals>
            <width> .K </width>
        </stateful>
    </statefuls>

Note <vals> .Map </vals>

And I have the following rule

rule <k> @processDec(counter Name:Id { type : T:CounterType ; SOpt:StatefulOptionals COpt:CounterOptionals }) => @addTableDirect(Name) ... </k>
     <statefuls>
        (.Bag =>
            <stateful>
                <stype> $counter </stype>
                <name> Name </name>
                <opts> ("$counter_type" |-> T) @processStatefulOpts(SOpt, ("$binding" |-> $static_global)) @processCounterOpts(COpt, ("$signed" |-> false) ("$saturating" |-> false)) </opts>
                <width> 0 </width> // = inf
                ...
            </stateful>
        ) ...
     </statefuls>

before this rule is applied my configuration is as follows:

<k>  @processDec ( counter my_indirect_counter { type : packets ; ( static : m_table ) ;  ( ( instance_count : 16384 ) ;  .StatefulOptionals ) .CounterOptionals } ) ~> .... </k>
...
<statefuls> .StatefulCellBag </statefuls>

After the application of the rules I get:

<k> @addTableDirect ( my_indirect_counter ) ~> ... </k>
<statefuls> 
  <stateful> 
    <stype> $counter </stype>
    <name> my_indirect_counter </name>
    <opts> "$counter_type" |-> packets "$instant_count" |-> 16384 "$table" |-> m_table "$saturating" |-> false "$signed" |-> false "$binding" |-> $static </opts>
    <vals> .Set </vals> 
    <width> 0 </width> 
  </stateful>
</statefuls> 

Note that <vals> is intialized with .Set instead of .Map

Unfortunately I can not create a minimal example that exhibits the problem as smaller programs do not exhibit this problem. For example this has no problem:

module TEST

    syntax X ::= "@processDec"

    configuration
    <T>
        <k> $PGM:X </k>
         <statefuls>
             <stateful multiplicity="*">
                 <stype> .K </stype>
                 <name> .K </name>
                 <opts> .Map </opts>
                 <vals> .Map </vals>

                 <width> .K </width>
             </stateful>
         </statefuls>
    </T>


    rule <k> @processDec => . ... </k>
         <statefuls>
            (.Bag =>
                <stateful>
                    <stype> "$coutner" </stype>
                    <name> "name" </name>
                    <opts> ("$counter_type" |-> "direct") </opts>
                    <width> 0 </width>  
                    ...
                </stateful>
            ) ...
         </statefuls>


endmodule
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant