[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [partial-reconfig] Write/Read data on SRAM
- To: partial-reconfig@xxxxxxxxxxxxxx
- Subject: Re: [partial-reconfig] Write/Read data on SRAM
- From: "Nathan Hillery" <nhillery1@xxxxxxxxx>
- Date: Fri, 29 Aug 2008 08:17:33 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=0Tqgsj+BqlcS4tRpJlzjs1c0LF9vFRjgzYVfVV5BaYs=; b=byLUcE6BXBITHY99TkmQ5b9gm7Mf+s6c4YJLi4xMCXJyWusJpOAMgbzxTlPRyDhrb/ C+/SeDp7nntczYrg2icfTgfWKpESljgoJp9n/Gya3wwNAEShkTlr96T0jPksRffPJA+m +GDc+2lF2rDMCb5JHdAE/gpYJCfc3CtsA4mhk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=rO4tGbBEuNG6kwl5stYyc6KZG2zLzaUOd8srhYaZ2pxx+F/F3qLxSJwMqH1USLYTPj Ga0adSLSvqYUqYyQDjz77i4ST/4bTK7BuLzsstYqEu3qqCnLpTxYBw1ou0vBOZdgvIkJ qbKWm/B5xSGlRwyCrIzjyxN9hNhkRJqQO92P0=
- In-reply-to: <6d6428bf0808280633j4ff2906dyd0f8bdf640573a45@xxxxxxxxxxxxxx>
- References: <6d6428bf0808280633j4ff2906dyd0f8bdf640573a45@xxxxxxxxxxxxxx>
- Reply-to: partial-reconfig@xxxxxxxxxxxxxx
- Sender: owner-partial-reconfig@xxxxxxxxxxxxxx
Your values are being sign-extended, as if they are treated as signed
integers. Try changing "char" to "unsigned char" in the definition of
buf.
On 8/28/08, Paolo Furia <paolo.furia@xxxxxxxxx> wrote:
> Hi all,
> I'm trying to write data (a partial bitstream) on SRAM and then read them.
> I'm working on a ML402 (with a virtex-4 fpga) and I send the data through
> RS232. I've a Microblaze on my system that manage all.
> I use the following C code:
>
>
> /* BITSTREAM_BASEADDR is the base address of SRAM */
>
> char buf, val;
> int i;
> Xuint32 baseaddr = BITSTREAM_BASEADDR;
>
> for (i=0; i<50492; i++){
>
> buf = XUartLite_RecvByte(UART_BASEADDR);
>
> XIo_Out8((baseaddr+i), buf);
>
> }
>
>
> xil_printf("Bitstream stored!\n\r");
>
>
> xil_printf("High address: %d\n\r", (baseaddr+i));
>
>
> /***** Cycle to read the first 10 values stored *****/
>
> xil_printf("value: %x\n\r\n\r", val);
>
> xil_printf("\n Primi 10 valori salvati:\n\r\n");
>
> for (i=0; i<10; i++){
>
> val = XIo_In8((BITSTREAM_BASEADDR+i));
>
> xil_printf("valore: %x\n\r\n\r", val);
>
> }
>
> /***** End of cycle *****/
>
>
>
> The first 10 values of the file I send are: FF FF FF FF 55 99 AA 66 04 00.
> But Microblaze reads from memory this: FFFFFFFF, FFFFFFFF, FFFFFFFF,
> FFFFFFFF, 55, FFFFFF99, FFFFFFAA, 66, 4, 0.
> I tried sending other values and I discovered that alla values between 0 and
> 127 are displayed well, while the values from 128 to 255 are dysplayed with
> FFFFFF ahead. Why? Do you have any suggestion? I'd very appreciate any help.
>
> Regards,
>
> Paolo Furia
>
___________________________
partial-reconfig mailing list
partial-reconfig@xxxxxxxxxxxxxx
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/partial-reconfig/