新聞中心

EEPW首頁(yè) > EDA/PCB > 設(shè)計(jì)應(yīng)用 > 用ARM對(duì)FPGA進(jìn)行配置的原理與方法

用ARM對(duì)FPGA進(jìn)行配置的原理與方法

作者: 時(shí)間:2012-05-31 來(lái)源:網(wǎng)絡(luò) 收藏

if (base == (void *) -1)

{

printf (Cannot mmap. );

return 0;

}

printf (Memory mapped at address %p. , base);

pioc = base + (addr MAP_MASK);

return 1;

}

int main (int argc, char **argv)

{

FILE *file;

char data[16];

int nbytes, i;

if (argc != 2)

{

printf (%s , argv[0]);

return -1;

}

file = fopen (argv[1], r);

if (!file)

{

printf (File %s not found. , argv[1]);

return -1;

}

if (!pioc_map ())

return -1;

pioc_setup ();

pioc_out_0 (nCONFIG);

for (i = 0; i 10000 pioc_in (nSTATUS); i++) { }

if (i == 10000)

{

printf (nSTATUS = 1 before attempting configuration. );

return -1;

}

pioc_out_1 (nCONFIG);

for (i = 0; i 10000 !pioc_in (nSTATUS); i++) { }

if (i == 10000)

{

printf (Timeout waiting for nSTATUS = 1. );

return -1;

}

while ((nbytes = fread (data, sizeof (char), sizeof (data), file)) > 0)

{

if (pioc_in (CONF_DONE))

{

printf (CONF_DONE = 1 while transmitting data. );

return -1;

}



關(guān)鍵詞: FPGA ARM 原理 方法

評(píng)論


相關(guān)推薦

技術(shù)專(zhuān)區(qū)

關(guān)閉