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?