資源簡介
內含三套基于openrisc的最小系統構建所需的軟件和硬件源碼。如果不想弄orpsoc和minsoc,想搭建自己的openrisc的soc,請參考。使用方法,請參考對應的blog內容。

代碼片段和文件信息
#include?“board.h“
#include?“uart.h“
#define?BOTH_EMPTY?(UART_LSR_TEMT?|?UART_LSR_THRE)
#define?WAIT_FOR_XMITR?\
????????do?{?\
????????????????lsr?=?REG8(UART_base?+?UART_LSR);?\
????????}?while?((lsr?&?BOTH_EMPTY)?!=?BOTH_EMPTY)
#define?WAIT_FOR_THRE?\
????????do?{?\
????????????????lsr?=?REG8(UART_base?+?UART_LSR);?\
????????}?while?((lsr?&?UART_LSR_THRE)?!=?UART_LSR_THRE)
#define?CHECK_FOR_CHAR?(REG8(UART_base?+?UART_LSR)?&?UART_LSR_DR)
#define?WAIT_FOR_CHAR?\
?????????do?{?\
????????????????lsr?=?REG8(UART_base?+?UART_LSR);?\
?????????}?while?((lsr?&?UART_LSR_DR)?!=?UART_LSR_DR)
void?uart_init(void)
{
??int?divisor;
??/*?Reset?receiver?and?transmiter?*/
??REG8(UART_base?+?UART_FCR)?=?UART_FCR_ENABLE_FIFO?|?UART_FCR_CLEAR_RCVR?|?UART_FCR_CLEAR_XMIT?|?UART_FCR_TRIGGER_14;
??/*?Disable?all?interrupts?*/
??REG8(UART_base?+?UART_IER)?=?0x00;
??/*?Set?8?bit?char?1?stop?bit?no?parity?*/
??REG8(UART_base?+?UART_LCR)?=?UART_LCR_WLEN8?&?~(UART_LCR_STOP?|?UART_LCR_PARITY);
??/*?Set?baud?rate?*/
??divisor?=?IN_CLK/(16?*?UART_BAUD_RATE);
??REG8(UART_base?+?UART_LCR)?|=?UART_LCR_DLAB;
??REG8(UART_base?+?UART_DLL)?=?divisor?&?0x000000ff;
??REG8(UART_base?+?UART_DLM)?=?(divisor?>>?8)?&?0x000000ff;
??REG8(UART_base?+?UART_LCR)?&=?~(UART_LCR_DLAB);
}
void?uart_putc(char?c)
{
??unsigned?char?lsr;
????????
??WAIT_FOR_THRE;
??REG8(UART_base?+?UART_TX)?=?c;
??if(c?==?‘\n‘)?{
????WAIT_FOR_THRE;
????REG8(UART_base?+?UART_TX)?=?‘\r‘;
??}
??WAIT_FOR_XMITR;
}
char?uart_getc(void)
{
??unsigned?char?lsr;
??char?c;
??WAIT_FOR_CHAR;
??c?=?REG8(UART_base?+?UART_RX);
??return?c;
}
char?*str?=?“Hello?world!!!\n“;
int?main?(void)
{
??char?*s;
??uart_init?();
??for?(s?=?str;?*s;?s++)
????uart_putc?(*s);
??while?(1)
????uart_putc?(uart_getc?()?+?1);
??return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4592??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\linux?下?or1k?gnu?toolchain?建立?(初稿)20080422\linux?下?or1k?gnu?toolchain?建立?(初稿)20080422.txt
?????文件???????1973??2013-03-22?17:21??openrisc下hello-uart仿真和開發板驗證\linux?下?or1k?gnu?toolchain?建立?(初稿)20080422.rar
?????文件????????444??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\build_rtl.php
?????文件???????1175??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\build_tb.php
?????文件???????1076??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\build_wb_mem.php
?????文件????????330??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\examples\data.txt
?????文件????????655??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\examples\readmemh.v
?????文件???????9560??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\hello.bin
?????文件???????8200??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\reset.bin
?????文件????????486??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\rtl\mem.tpl.v
?????文件???????1363??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\rtl\ramb16_s9.tpl.php
?????文件????????823??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\rtl\ramb16_s9.tpl.v
?????文件???????1225??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\rtl\有注釋信息ramb16_s9.tpl.v
?????文件???????2557??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\rtlmem.php
?????文件????????464??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\tb\mem.tpl.v
?????文件???????2100??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\tb\wb_mem.tpl.v
?????文件????????630??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\tb\另一版本mem.tpl.v
?????文件???????1852??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\tpl\wb_mem.tpl.v
?????文件???????1392??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\view.php
?????文件????????977??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用\membuild\說明.txt
?????文件??????11356??2013-03-22?17:21??openrisc下hello-uart仿真和開發板驗證\membuild?20080521?生成的代碼可以使用.rar
?????文件???????9560??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\bin\hello.bin
?????文件???????8200??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\bin\reset.bin
?????文件????1448821??2013-03-22?17:13??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\mini_or1200_top.bit
?????文件???????6150??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\or32soft\dat0.txt
?????文件???????6150??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\or32soft\dat1.txt
?????文件???????6150??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\or32soft\dat2.txt
?????文件???????6150??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\or32soft\dat3.txt
?????文件???????9560??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\or32soft\hello.bin
?????文件????????418??2013-03-22?17:23??openrisc下hello-uart仿真和開發板驗證\mini_or1200?20080521?仿真和上板調試通過\mini_or1200\or32soft\mem_tb_U0.v
............此處省略215個文件信息
評論
共有 條評論