title: Delay in bitvector Output assignment
body: <p>I am a beginner in SystemC, and I really need your help in solving a timing issue. </p>
  
  <p>Please find the stimuli.h code below, </p>
  
  <pre><code>    SC_MODULE(datagen)
  {
      public: 
      sc_out&lt;sc_bv&lt;8&gt;&gt; busin_o;   
      SC_CTOR(datagen);
  
      /*private:*/
  
      void testgen(void);
      void asTakt(void);
  };
  </code></pre>
  
  <pre><code>    void datagen::testgen(void)
  {       
      busin_o-&gt;write("11111111");
      cout&lt;&lt; "-------------------------------------"&lt;&lt; endl;
      cout &lt;&lt; "In dataGen::testgen: @"
           &lt;&lt; sc_time_stamp()
           &lt;&lt; " Busin in datagen: "&lt;&lt; busin_o       
           &lt;&lt;endl;    
  
      wait(1,SC_NS);
      cout&lt;&lt; sc_delta_count() &lt;&lt; endl;    
      busin_o-&gt;write("00111111");
      cout&lt;&lt; "-------------------------------------"&lt;&lt; endl;
      cout &lt;&lt; "In dataGen::testgen: @"
           &lt;&lt; sc_time_stamp()
           &lt;&lt; " Busin in datagen: "&lt;&lt; busin_o       
           &lt;&lt;endl;  
  
      wait(1,SC_NS);  
      busin_o-&gt;write("10000111");
      cout&lt;&lt; "-------------------------------------"&lt;&lt; endl;
      cout &lt;&lt; "In dataGen::testgen: @"
           &lt;&lt; sc_time_stamp()
           &lt;&lt; " Busin in datagen: "&lt;&lt; busin_o       
           &lt;&lt;endl;  
      wait(1,SC_NS);
      busin_o-&gt;write("11111110");
      cout&lt;&lt; "-------------------------------------"&lt;&lt; endl;
      cout &lt;&lt; "In dataGen::testgen: @"
           &lt;&lt; sc_time_stamp()
           &lt;&lt; " Busin in datagen: "&lt;&lt; busin_o       
           &lt;&lt;endl; 
      cout&lt;&lt;"Intended end of simulation"&lt;&lt; endl;
      sc_stop();  
  }
  </code></pre>
  
  <p>inputs2.h </p>
  
  <pre><code>    SC_MODULE(inputs)
  {
      public:
  
      sc_in&lt;sc_bv&lt;8&gt;&gt; busin;
      sc_out&lt;sc_bv&lt;8&gt;&gt; pout;
      sc_out&lt;sc_bv&lt;8&gt;&gt; out;
      SC_CTOR(inputs);
  
      private:
      /* method*/
      void mydesign(void);
  };
  </code></pre>
  
  <p>inputs2.cpp</p>
  
  <pre><code>inputs::inputs(sc_module_name inst)
      : sc_module(inst)
  {   
      cout&lt;&lt;"Constructor- inputs: "&lt;&lt; name() &lt;&lt;endl;
      SC_METHOD(mydesign);
      sensitive &lt;&lt; busin;
  }
  void inputs::mydesign()
  {
  
      cout&lt;&lt; "-------------------------------------"&lt;&lt; endl;
      cout&lt;&lt;"Mydesign Activated @ "&lt;&lt;sc_time_stamp() &lt;&lt;endl;
      cout&lt;&lt; "-------------------------------------"&lt;&lt; endl;
      cout &lt;&lt; "In Inputs::mydesign: @"
           &lt;&lt; sc_time_stamp()
           &lt;&lt; " Busin in Inputs: "&lt;&lt; busin       
           &lt;&lt;endl;  
      pout-&gt; write(busin.read());
      cout &lt;&lt; "In Inputs::mydesign: @"
           &lt;&lt; sc_time_stamp()
           &lt;&lt; " pout in Inputs: "&lt;&lt; pout
           &lt;&lt;endl;    
  }
  </code></pre>
  
  <p>The output that is seen in the terminal is shown below.</p>
  
  <pre><code>    Copyright (c) 1996-2018 by all Contributors,
      ALL RIGHTS RESERVED
      Warning: (W506) illegal characters: data generator substituted by data_generator
      In file: ../../../src/sysc/kernel/sc_object.cpp:247
      Constructor- datagen: topblock.data_generator
      Constructor- inputs: topblock.inputs
      Constructor- top :topblock
      Simulation started time resolution :1 ps
      -------------------------------------
      Mydesign Activated @ 0 s
      -------------------------------------
      In Inputs::mydesign: @0 s Busin in Inputs: 00000000
      In Inputs::mydesign: @0 s pout in Inputs: 00000000
      -------------------------------------
      In dataGen::testgen: @0 s Busin in datagen: 00000000
      -------------------------------------
      Mydesign Activated @ 0 s
      -------------------------------------
      In Inputs::mydesign: @0 s Busin in Inputs: 11111111
      In Inputs::mydesign: @0 s pout in Inputs: 00000000
      2
      -------------------------------------
      In dataGen::testgen: @1 ns Busin in datagen: 11111111
      -------------------------------------
      Mydesign Activated @ 1 ns
      -------------------------------------
      In Inputs::mydesign: @1 ns Busin in Inputs: 00111111
      In Inputs::mydesign: @1 ns pout in Inputs: 11111111
      -------------------------------------
      In dataGen::testgen: @2 ns Busin in datagen: 00111111    
      -------------------------------------
      Mydesign Activated @ 2 ns
      -------------------------------------
      In Inputs::mydesign: @2 ns Busin in Inputs: 10000111
      In Inputs::mydesign: @2 ns pout in Inputs: 00111111
      -------------------------------------
      In dataGen::testgen: @3 ns Busin in datagen: 10000111    
      Intended end of simulation
      Info: /OSCI/SystemC: Simulation stopped by user.
  </code></pre>
  
  <p>The two questions I have are,</p>
  
  <p>1) mydesign block is being called twice @ 0 NS </p>
  
  <p>2) Why does busin in my datagen file update after 1ns? I can already see the value in inputs.cpp at 0 NS. How can it happen that busin gets its value in datagen but updates in inputs.cpp first. 
  (Note : Inputs.cpp file receives busin value from datagen)
  If you say that the behavior is correct and I don't have to modify anything in my code, then it's all good. </p>
  
  <p>Any help is appreciated. Thanks in advance.</p>