OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

[/] [mlite/] [trunk/] [tools/] [test.c] - Diff between revs 43 and 137

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 43 Rev 137
Line 16... Line 16...
--
--
--   Save the opcodes in "code.txt".
--   Save the opcodes in "code.txt".
--
--
--   The interrupt vector is set to address 0x30.
--   The interrupt vector is set to address 0x30.
--------------------------------------------------------------------*/
--------------------------------------------------------------------*/
#ifdef MLITE
#ifndef WIN32
#undef putchar
#undef putchar
// The Plasma CPU VHDL supports a virtual UART.  All character writes
#define putchar(C) *(volatile unsigned char*)0x20000000=(unsigned char)(C)
// to address 0xffff will be stored in the file "output.txt".
 
#define putchar(C) *(volatile unsigned char*)0xffff=(unsigned char)(C)
 
void isr_enable(int);
 
#else
 
#define isr_enable(A)
 
#endif
#endif
 
 
char text[]="Testing the Plasma core.\n";
char text[]="Testing the Plasma core.\n";
char buf[20];
char buf[20];
int xyz=0xbadbeef;
int xyz=0xbadbeef;
Line 120... Line 115...
   }
   }
   putchar('\n');
   putchar('\n');
   return 0;
   return 0;
}
}
 
 
int main2()
int main(void)
{
{
   long i,j;
   long i,j;
   char char_buf[16];
   char char_buf[16];
   short short_buf[16];
   short short_buf[16];
   long long_buf[16];
   long long_buf[16];
 
 
   //Uncomment to test interrupts
 
//   isr_enable(1);
 
 
 
#if 1 
#if 1 
   //test shift
   //test shift
   j=0x12345678;
   j=0x12345678;
   for(i=0;i<32;++i) {
   for(i=0;i<32;++i) {
      print_hex(j>>i);
      print_hex(j>>i);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.