Thursday, August 20, 2009

Modding an HP Proliant DL585 to take an EVE Zebu UF2

I am the proud "controller" of an EVE Zebu UF2 emulation accelerator (a big PCI card covered in FPGAs). One of its biggest selling points is their Transactors which allow you to present your design with the interfaces it would experience if it were real, completely abstracting away the PCI bus.

However when I say big I mean triple height and full length. It uses 64 bit PCI/66. (For those considering purchasing a UF4 card most PCs can't fit it as it is larger still).

So I need a computer to host it in!

Enter the HP DL585 - a lovely machine. Built as solidly as a tank and everything is terribly easily accessible either from the front or the top. Everything. At a push I think I could swap out the motherboard and be back up and running in 30 minutes from cracking the case.

The original engineers designed it for cable-less operation (and very nearly succeeded!) but the EVE ZeBu-UF needs power from a 4 pin molex (found on most pre-SATA HDDs).

So what to do? Spotting this SCA backplane and knowing that HDDs take 12V, 5V and 3.3V power I had my solution. Mod a molex connector onto the pins on the back of one of the SCA sockets.

Firstly I checked the specifications for the ZeBu: 25W at 12V which is a current of 2.08A. Secondly I checked the specifications of the SCA2 connector: Section 6.4.1 of the SFF-8046 standard specifies a surge current of 5A and a constant supply of 2.5A. This means that one socket can supply the necessary power.

However, several provisos first: This will void your warranty. The SCA-2 connector transfers power to the drive using several pins for each voltage (12V, 5V and 3.3V) to reduce their resistivity to high current. By design the clusters of pins supplying the same voltage are next to each other making it easier. Probe for the resistance between the pins you think are the right ones - it needs to be zero.

The mod requires soldering the little clusters of pins together with fine wire (get some strands out of a multistrand wire) and then attached the cables. Note - don't include the Precharge pins - wiring them to the rest of the supply could cause unexpected operation as they will no longer function correctly when you insert a HDD in the front. After you are done, check, double check and triple check. Use a magnifier/microscope to check the soldering. Clean the area of any bits of solder. Probe the resistivity again. This could be an expensive mistake if there is a problem!

Power on (fingers crossed) and bingo - 12V and 5V.

Here is a photo of the modded card in position:


...and a photo of the UF2 in the PCI bay (I have two power connectors just in case I can get another UF2 - wishful thinking I know):

Thursday, July 23, 2009

Loading new maps into Nokia Maps on an N95 without a cable or bluetooth

Foolishly I arrived in San Francisco for MSE without loading the California maps into my phone.

This presented me with a pretty conundrum. Nokia's recent upgrade to Ovi Maps meant that the new maps uploader wanted a phone connected with Nokia PC Suite via the USB-A to Mini-B cable or bluetooth in PCSuite mode.

However without a cable or bluetooth (I have my old IBM X31 laptop, hand upgraded with Intel 2200BG Wifi) what can you do?

Turn to an almost forgotten technology: IrDa. The N95 8GB has a 115200 IrDa port on it and the Thinkpad X31 has a 4Mbps one.
  1. Download the old "Nokia Map Loader" - this talks to the phone as a mass storage device.
  2. Connect the phone via IrDa to the PCSuite.
  3. Run the Nokia Map Loader
Upload the maps - took a very long time!

[An alternative to doing this is use the following blog post to download the maps directly. This can even be done on your mobile!]

Friday, July 17, 2009

Off to Microelectronic Systems Education

...in sunny San Francisco.

MSE Conference (and its partner EWME) provide a fantastic venue to explore and demonstrate novel ways to teach complex system-on-chip designs.

I shall also be attending the tutorials - One on the Cypress PSoC platform, a fascinating combination of a digital microcontroller, a programmable logic device and a section of programmable analogue logic. The second will be on several techniques from Synopsys:

  1. Structured Methodology for Successful Low Power Verification
  2. Power-Performance Optimization of Digital Circuits

Sunday, July 12, 2009

Fix for amanda 2.5.1p1 on MacOSX PowerPC

Bug causes the following error message in the following stable releases 2.5.1p1, 2.5.1p3, 2.6.1p1

Amanda Backup Client Hosts Check
--------------------------------
ERROR: NAK mac-mini: user backup from hs-dhgl7ce.msindustries.com is not
allowed to execute the service noop: /Users/amandabackup/.amandahosts:
owned by id 5000, should be 529288
Client check: 1 host checked in 0.859 seconds, 1 problem found

There is no user of UID of 529288 on the machine.

Here is a snip of the amandad log after a modification to add Print statements printing the UID as dereferenced from the pointer in check_user_amandahosts() in common-src/security-util.c


amandad: time 0.187: sec: calling accept_fn
Print uid: 5000
Print UID on entry now: 5000
check_user_amandahosts(host=hs-dhgl7ce.msindustries.com, pwd=0x100400, remoteuse
r=backup, service=selfcheck)
amandad: bsd: processing file: /Users/amandabackup/.amandahosts
amandad: bsd: owner=amandabackup group=wheel mode=600
Print UID after stralloc: 529288
Print UID after fopen: 529288
Print sbuf.st_uid now: 5000
Print UID after fstat: 529288
amandad: bsd: processing line: hs-dhgl7ce.msindustries.com backup="" amdump=""
amandad: bsd: comparing "hs-dhgl7ce.msindustries.com" with


The bug has been fixed by caching the pwd->ps_uid at the start of the function and using the test against that. Also note that the bug behavior changed at some point as the UID changed from 529288 to 0. Suggests a buffer overrun, endianness or thread issues.

Here is the modified check_user_amandahosts() security-util.c (don't forget to modify the top of the file to enable secprintf().


/*
* Check to see if a user is allowed in. This version uses .amandahosts
* Returns -1 on failure, or 0 on success.
*/
char *
check_user_amandahosts(
const char * host,
struct in_addr addr,
struct passwd * pwd,
const char * remoteuser,
const char * service)
{
char *line = NULL;
char *filehost;
const char *fileuser;
char *ptmp = NULL;
char *result = NULL;
FILE *fp = NULL;
int found;
struct stat sbuf;
char n1[NUM_STR_SIZE];
char n2[NUM_STR_SIZE];
int hostmatch;
int usermatch;
char *aservice = NULL;

uid_t tmp_pw_uid = pwd->pw_uid;
secprintf(("Print UID on entry now: %d\n",pwd->pw_uid));

secprintf(("check_user_amandahosts(host=%s, pwd=%p, "
"remoteuser=%s, service=%s)\n",
host, pwd, remoteuser, service));

ptmp = stralloc2(pwd->pw_dir, "/.amandahosts");
#if defined(SHOW_SECURITY_DETAIL) /* { */
show_stat_info(ptmp, "");;
#endif /* } */
secprintf(("Print UID after stralloc: %d\n",pwd->pw_uid));
if ((fp = fopen(ptmp, "r")) == NULL) {
result = vstralloc("cannot open ", ptmp, ": ", strerror(errno), NULL);
amfree(ptmp);
return result;
}
secprintf(("Print UID after fopen: %d\n",pwd->pw_uid));

/*
* Make sure the file is owned by the Amanda user and does not
* have any group/other access allowed.
*/
if (fstat(fileno(fp), &sbuf) != 0) {
result = vstralloc("cannot fstat ", ptmp, ": ", strerror(errno), NULL);
goto common_exit;
}
secprintf(("Print sbuf.st_uid now: %d\n",sbuf.st_uid));
secprintf(("Print UID after fstat: %d\n",pwd->pw_uid));

/*if (sbuf.st_uid != pwd->pw_uid) {*/
if (sbuf.st_uid != tmp_pw_uid) {
snprintf(n1, SIZEOF(n1), "%ld", (long)sbuf.st_uid);
snprintf(n2, SIZEOF(n2), "%ld", (long)pwd->pw_uid);
result = vstralloc(ptmp, ": ",
"owned by id ", n1,
", should be ", n2,
NULL);
goto common_exit;
}

Wednesday, June 24, 2009

Synopsys Designware System Level Library Compiled


Rebuilding everything from scratch with a clean install, and setting the following environment variables:


CC /usr/local/gcc/3.3.6/bin/gcc
CXX /usr/local/gcc/3.3.6/bin/g++
LD /usr/local/gcc/3.3.6/bin/g++


and look

Tuesday, June 23, 2009

Synopsys DWSLL still won't compile even with gcc-3.3.6 [FIXED]

[see above post, must have had a broken systemc install left lying about]

Having built a version of gcc-3.3.6 that compiles correctly and passes the tests I now get a new (and unpleasant) build error:


/usr/local/gcc/3.3.6/bin/gcc  -o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/vptest .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/CoreManager.ctor.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/IntCtrl.ctor.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/MuxRoutingView.ctor.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/Tester.ctor.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/UART.ctor.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/powerDashboard.ctor.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/registerView.ctor.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/vptest.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/vptest_sc_main.o .vptest//linux/dwsll/gcc-3.3.6/osci-2.2.0/VT100.ctor.o -L/opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib -llt-O -g -fPIC -Wl,-Bsymbolic   /opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib/snps_tlm.a -L/opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib -L/opt/fastcad/software/systemc/systemc-2.2.0/lib-linux -L/opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/../runtime/Shared/Debuggers -lpthread -lsystemc -lqt-mt -lvdidll -ldl -rdynamic /opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib/libsimdll.a 2>&1 | c++filt
/opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib/snps_tlm.a(simlog.o)(.text+0xc88): In function `Simlog::Abort(IUnit*, char const*, ...)':
: undefined reference to `typeinfo for unsigned'
/opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib/snps_tlm.a(snps_tlm_imemory_tlm2.o)(.gnu.linkonce.r._ZTIPN8snps_tlm20vre_config_extensionE+0x0): undefined reference to `vtable for __cxxabiv1::__pointer_type_info'
/opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib/snps_tlm.a(snps_tlm_manager.o)(.text+0x3aa5): In function `snps_tlm::manager::SimMain()':
: undefined reference to `typeinfo for int'
/opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib/snps_tlm.a(snps_tlm_manager.o)(.gcc_except_table+0x48c): undefined reference to `typeinfo for int'
/opt/fastcad/software/synopsys/linux/dw_sys-l-lib_2008.12/linux/dwsll/gcc-3.3.6/osci-2.2.0/lib/snps_tlm.a(snps_tlm_manager.o)(.gnu.linkonce.r._ZTIP15ManagerListener+0x0): undefined reference to `vtable for __cxxabiv1::__pointer_type_info'
/opt/fastcad/software/systemc/systemc-2.2.0/lib-linux/libsystemc.a(sc_main_main.o)(.gcc_except_table+0x38): undefined reference to `typeinfo for char const*'
collect2: ld returned 1 exit status

Synopsys Innovator and Designware System Level Library II

More things to do with Synopsys Designware System Level Library.

Just so you know:

When they say use gcc-3.3.6, they mean gcc-3.3.6. RHEL3 shipped with gcc-3.2.X and RHEL4 with gcc-3.4.X. Both build models without errors but when executed segfault.

I am building a copy of gcc-3.3.6 now following this excellent guide by Tellurian.

More to follow.

Laird Tpcm 7250 is as good as Honeywell PTM7950 as thermal paste / interface for PC

[This is not very scientific, however it is notable. At 7.5W/m-K vs the installed SYY-157 at 15.7 W/m-K it performed better in real world lo...