



Register Allocation Problems ?
by Unknown on Dec 18, 2003 |
Not available! | ||
hi, Now I am thinking a problem. If there are 5 parameters needed assigned to the register for example on AMBA-AHB or Wishbone, processor could control the module via R/W the 5 parameters. Thus, we need to deal with the register alocation to define the register. It comes up with such many ways to assign each parameter to a 32-bits wide register. If A paramater is 1 bit, B is 2 bits, C is 9 bits, D is 7 bits, E is 16 bits, should we put as many as bits in one 32-bits register, i.e. to increase the register density for less register access ? However, the driver needs to pack or unpack the registers to extract/put the information it need. It also takes time and slow down the response time of the driver. What's the generally way to deal with it ? How to balance it ? Should we divided the 32-bits register as 4 or 8 -bits per block and just put one parameter to it for easy s/w decode ? For example, 0000000A000000B0000000C as a 32-bits register where A is 1-bit, B is 2 bits, C is 9-bits. Appreciate for your any comments. Thanks Nanson |
Register Allocation Problems ?
by Unknown on Dec 18, 2003 |
Not available! | ||
Aloha!
Quoting NansonHuang at ITRI.ORG.TW:
Now I am thinking a problem. If there are 5 parameters needed assigned to
Har do give a simple answer to that question. It greatly depends on the
processor and the compiler, unless you use assembler in which case it's the
processor ISA that will set the performance for bit handling.
If, for example the register is a control and status register with a fixed set
of possible values in the application, you can usually create bitmasks and
simply do AND, OR-operations to extract the bits and even perform the set/check
operations directly without any packing/unpacking.
If you need to convert to, say signed integer values you *might* need to do
conversion operations and packing/unpacking, but you might be better off letting
the application handle that, keeping the driver simple. Some applications may
not need the conversion and would be better off then.
--
Med vänlig hälsning, Yours
Joachim Strömbergson - Alltid i harmonisk svängning.
VP, Research & Development
----------------------------------------------------------------------
InformAsic AB / Hugo Grauers gata 5B / SE-411 33 GÖTEBORG / Sweden
Tel: +46 31 68 54 90 Fax: +46 31 68 54 91 Mobile: +46 733 75 97 02
E-mail: joachim.strombergson at informasic.com Home: www.informasic.com
----------------------------------------------------------------------
the register for example on AMBA-AHB or Wishbone, processor could control the module via R/W the 5 parameters. Thus, we need to deal with the register alocation to define the register. It comes up with such many ways to assign each parameter to a 32-bits wide register. If A paramater is 1 bit, B is 2 bits, C is 9 bits, D is 7 bits, E is 16 bits, should we put as many as bits in one 32-bits register, i.e. to increase the register density for less register access ? However, the driver needs to pack or unpack the registers to extract/put the information it need. It also takes time and slow down the response time of the driver. What's the generally way to deal with it ? How to balance it ? Should we divided the 32-bits register as 4 or 8 -bits per block and just put one parameter to it for easy s/w decode ? For example, |



