|
Message
From: Damjan Lampret<damjanl@o...>
Date: Wed Jul 20 22:16:43 CEST 2005
Subject: [openrisc] openrisc MAC instructions
Hi Michaelit could be. I'll have a look. Also please make sure you use the latest version, and not some old version.
regards, Damjan
----- Original Message ----- From: "michael scott" <mike.scott@j...> To: <openrisc@o...> Sent: Wednesday, July 20, 2005 5:41 PM Subject: [openrisc] openrisc MAC instructions
> Hi All, > In the Openrisc architecture manual under the description > for l.macrc rD it says: > > "Once all instructions in MAC pipeline are completed, the contents of MAC > is placed into general-purpose register rD and MAC accumulator is cleared" > > however on running the code below the MAC does't appear to stall/halt and > the current value in the MAC pipline is used as opposed to the final value > > The workaround is (as shown) to stick a couple of l.nops to allow > time for the pipline to empty. Howver I would expext the hardware to > automatically wait on reading the spec > > #--------------------------------------------------------------------------- > --- > # Multiply-Accumulate Test > #--------------------------------------------------------------------------- > --- > > l.movhi r2,0x0000 # 2 -> r2 (1st multipier) > l.ori r2,r2,0x0002 > l.movhi r6,0x0000 # 16 -> r6 (2nd multipier) > l.ori r6,r6,0x0010 > l.macrc r4 # read MACHi;MACHl into r4 & clear the > MAC accumulator > > l.mac r2,r6 # MAC = 0x20 > l.mac r2,r6 # MAC = 0x40 > l.mac r2,r6 # MAC = 0x60 > l.mac r2,r6 # MAC = 0x80 > l.mac r2,r6 # MAC = 0xa0 > > # l.macrc r4 # 0x60 -> r4 FAIL! > > l.nop # wait for MAC pipeline to complete > l.nop > l.macrc r4 # oxa0 -> r4 OK ! > > > _end: > l.j _end > l.nop > l.nop > l.nop > l.nop > > Is this a bug in the openrisc ? > > regards, > > Mike Scott > > ___________________________________________________ > Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK > www.jennic.com Tel: +44 (0) 114 2812655 Confidential > ___________________________________________________ > > _______________________________________________ > http://www.opencores.org/mailman/listinfo/openrisc
|
 |