How to config matrix multiplier in gem5

2019-08-04 10:39发布

问题:

We are planning to simulate google's Tensor processing unit(TPU) using gem5. We are not sure where to start with on gem5. We have followed all the tutorials in the learning folder. First, we want to implement matrix multiplier. How can we do that?

回答1:

If I understood correctly, you want to add a new device to gem5, that does matrix multiplication.

I have not seen any good tutorials on adding devices to gem5 yet. When I learn it, I will write one.

So, your best bet is to have a look at existing gem5 source code, look under src/dev, and try to find the device that looks most similar to yours.

The device / gem5 interface should not be too hard: you basically just have to understand how to do the following:

  • registers
  • interrupts
  • DMA

Then, I recommend that you test those things out with:

  • bare metal programs. Here is a possible setup. These will allow you to skip boot, which is a huge win.
  • a Linux kernel module, to actually run content, when you feel that you are almost done

Maybe you can get some inspiration from this related QEMU answer: How to add a new device in QEMU source code?



标签: gem5