MSP430 SIM: Add support for hardware multiply

Nick Clifton nickc@redhat.com
Tue Jan 5 16:43:00 GMT 2016


Hi Mike,

>>    I am applying the attached patch to add support for simulating the
>>    hardware multiply feature found on some MSP430 MCUs.

> this broke the testsuite:
> FAIL: msp430 add.s (execution)

Actually, as far as I can see this test never should have worked in the 
first place.  The problem is that the test harness code (in 
testutils.inc) assumes that the VMA and LMA addresses of the .data 
section are the same.  This is not the case (at least for the msp430), 
and without runtime code to copy data from the LMA address to the VMA 
address all the data addresses in the test executables are wrong.

So, I am checking in the following two patches.  The first patch updates 
the linker's built in link script so that it does not place data into 
the msp430's hardware address range, and so that that it provides a 
symbol (__romdatastart) with the LMA address of the .data section. 
[Note - as far as I can see only the sim tests actually use the linker's 
built in linker script.  Everyone else uses scripts explicitly provided 
on the linker command line].

The second patch updates the testutils.inc file so that it will use the 
LMA addresses of the strings in the .data section not the VMA addresses. 
  This makes the tests work, although it is a bit of a hack.  A proper 
solution would be to provide start-up code that copies the data from the 
LMA address to the VMA address before the test proper runs, but this 
seems like overkill to me.

Cheers
   Nick

ld/ChangeLog
2016-01-05  Nick Clifton  <nickc@redhat.com>

	* emulparams/msp430elf.sh (RAM_START): Move to 0x500 - above the
	MSP430 hardware multiply address range.
	* scripttempl/elf32msp430.sc (__romdatastart): Define.
	(__romdatacopysize): Define.
	* scripttempl/elf32msp430_3.sc: Likewise.

sim/testsuite/sim/msp430/ChangeLog
2016-01-05  Nick Clifton  <nickc@redhat.com>

	* testutils.inc (__pass): Use the LMA addresses of the _passmsg
	symbol.
	(__fail): Likewise.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: msp430.sim.test.patch
Type: text/x-patch
Size: 1546 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160105/2e820b5d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msp430.ld-scripts.patch
Type: text/x-patch
Size: 1240 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160105/2e820b5d/attachment-0001.bin>


More information about the Binutils mailing list