[libre-riscv-dev] TLB

Daniel Benusovich flyingmonkeys1996 at gmail.com
Mon Apr 22 07:03:27 BST 2019


On Sun, Apr 21, 2019 at 10:55 PM Daniel Benusovich
<flyingmonkeys1996 at gmail.com> wrote:
>
> > encoder is a one-out, therefore can be used as an index into the write_array?
> >
> > the for-loop generates N Case statements equal to i, therefore it's:
> >
> > * if self.encoder.o == 1 write_port == self.write_port[1]
> > * if self.encoder.o == 2 write_port == self.write_port[2]
> > * if self.encoder.o == 3 write_port == self.write_port[3]
> > ....
> > ....
> >
> > might as well just be:
> >
> > write_port = self.write_array[self.encoder.o]
>
> I kept getting some ArrayProxy value out of the array whenever I tried
> this. I do not know why.

Looks like this was the problem

       > asdf = Array(Memory(4,4) for x in range(4))
       > asdf[self.encoder.o].read_port()

When you call a function directly on the arrayproxy it fails with the
following message:

      > builtins.TypeError: 'ArrayProxy' object is not callable

But you are able to call elements out of the ArrayProxy just fine. Weird



More information about the libre-riscv-dev mailing list