Re: Conversion error: Type mismatch with ear lier assignment

Josy Boelen <[email protected]>
Newsgroups gmane.comp.python.myhdl
Message-ID <[email protected]>
Hi Guy,

I studied this a bit deeper and went looking for some 'variable' 
examples in the MyHDL doc and found this one:
def bin2gray(B, G, width):

    """ Gray encoder.

    B -- input intbv signal, binary encoded
    G -- output intbv signal, gray encoded
    width -- bit width

    """

    @always_comb
    def logic():
        Bext = intbv(0)[width+1:]
        Bext[:] = B
        for i in range(width):
            G.next[i] = Bext[i+1] ^ Bext[i]

    return logic

And to my surprise it uses the [:] ...
So it may not be a bug, as it is actually _documented_ behaviour ...
But I maintain that it is inconsistent because e.g.:  if I change
        count_v = count_v + 1
into:
        count_v += 1
the conversion will pass without errors.

Regards,

Josy



------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.