coreboot-kgpe-d16/util/romcc/tests/simple_test60.c
Eric Biederman 9008960339 - Upgrade to romcc version 0.63
This includes more test cases
  Lots of small bug fixes
  A built in C preprocessor
  Initial support for not inlining everything
  __attribute__((noinline)) works
  Better command line options and help
  Constants arrays can be read at compile time
  Asm statements that are not volatile will now be removed when their outputs go unused
  Loads and stores that are not volatile will be removed when their values go unused
  The number of FIXMES in the code is finally starting to go down.


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1582 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2004-05-28 14:11:54 +00:00

32 lines
695 B
C

struct mem_param {
unsigned char cycle_time;
unsigned char divisor;
unsigned char tRC;
unsigned char tRFC;
unsigned dch_memclk;
unsigned short dch_tref4k, dch_tref8k;
unsigned char dtl_twr;
char name[9];
};
static void test(void)
{
static const struct mem_param param0 = {
.name = "166Mhz\r\n",
.cycle_time = 0x60,
.divisor = (6<<1),
.tRC = 0x3C,
.tRFC = 0x48,
.dch_memclk = 5 << 20,
.dch_tref4k = 0x02,
.dch_tref8k = 0x0A,
.dtl_twr = 3,
};
int value;
unsigned clocks;
const struct mem_param *param;
param = &param0;
value = 0x48;
#warning "this generated word loads instead of byte loads"
clocks = (value + (param->divisor << 1) - 1)/(param->divisor << 1);
}