Weird error

Merkourios Katsimpris <[email protected]> Sat, 16 Jan 2016 13:55:54 +0200
Newsgroups gmane.comp.python.myhdl
Message-ID <[email protected]>
Hallo guys,

I tried to run this code:

def dff(q,d,clk,rst):

       @always(clk.posedge,rst.posedge)
       def logic():
             if rst==1:
                   q.next=0
             else:
                   q.next=d

       return logic


def param_reg(q,d,clk,rst,width=4,n=2):

      signal_list=[Signal(intbv(0)[width+1:]) for i in range(n+1)]
      instance_list=[dff(signal_list[i+1],signal_list[i],clk,rst) for i 
in range(n)]

      @always_comb
      def logic():
           signal_list[0].next=d
           q.next=signal_list[n+1]

      return logic,instance_list


but I get the following error:AlwaysCombError: signal (signal_list) used 
as inout in always_comb function argument

when i change the code of param_reg to :

def param_reg(q,d,clk,rst,width=4,n=2):

      signal_list=[Signal(intbv(0)[width+1:]) for i in range(n+1)]
      instance_list=[dff(signal_list[i+1],signal_list[i],clk,rst) for i 
in range(n)]

      @always_comb
      def logic():
           signal_list[0].next=d
      @always_comb
      def logic2():
           q.next=signal_list[n+1]

      return logic,instance_list,logic2

It works fine. Do you know whats the problem?

Thanks

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140