Clarification on Lab2 task

Clarification on Lab2 task

by Leonardo Mussa -
Number of replies: 2

Hello,

I am not sure I understand well what we are expected to do for Lab2.


In the slides "Custom Instruction (slides) + Lab2" it says "Implement it in an accelerator module": what is the difference with "Implement it as a custom instruction"?

If I understand well a custom instruction is a logic circuit we add directly inside the processor, does this mean that for the "Accelerator module" we need to create an external component?



I have also another doubt: in the slides "Profiling (slides)" it says "... to exercise profiling make the Altera tutorial...". What is this referring to?



Thanks a lot for your help!

In reply to Leonardo Mussa

Re: Clarification on Lab2 task

by Sahand Kashani-Akhavan -

Hi,

The goal of this lab is to implement performance-enhancing circuitry for a workload that is difficult to express in C, but which can be done in a very parallel fashion in hardware (bit pattern shuffling). There are multiple hardware implementations possible for this performance-enhancing circuitry:

  1. Creating a hardware accelerator: A unit which is external to the CPU that contains a read/write DMA engine, as well as the bit pattern shuffling circuitry.
  2. Creating a custom instruction: A unit that is internal to the CPU that does not contain a read/write DMA, but rather just the bit pattern shuffling circuitry.

Using the custom instruction approach makes it easier to accelerate software code as you can replace a few loops and branches which were used in C to do the bit shuffling with a single instruction that the compiler understands and transmits to the CPU's ALU. However, custom instructions can have less performance than a custom accelerator with a DMA unit, and the goal of this lab is to quantify this difference and get a feel for how significant it is, and if the effort needed to design a custom accelerator with a DMA unit on a bus is worth it depending on the workload.

The profiling tutorial you are asking about is this one:
https://moodlearchive.epfl.ch/2019-2020/pluginfile.php/530941/mod_resource/content/0/laboratories/Profiling_NIOSII_an391.pdf

It shows you how to use the GNU profiler on a Nios II system, along with the caveats this entails.

In reply to Sahand Kashani-Akhavan

Re: Clarification on Lab2 task

by René Beuchat -

For the tutorial, a more recent document is available:

a more recent document is available (2011).

https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/an/an391.pdf

Associated with a web site:

https://www.intel.com/content/www/us/en/programmable/documentation/iga1446487888057.html#iga1464370749012

and a full document on Embedded Design from IntelFPGA:

https://www.intel.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/nios2/edh_ed_handbook.pdf

The idea is NOT to do the tutorial as explained, but to see the methodology in step by step.

I hope it will help.

RB