- Timestamp:
- 04/08/11 11:08:37 (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sim/simula.do
r27 r34 49 49 #vsim -c -t ps -novopt +notimingchecks work.tb_top glbl 50 50 51 add wave sim:/tb_top/W1_inst/dram_wb_inst/*51 #add wave sim:/tb_top/W1_inst/dram_wb_inst/* 52 52 #exit 53 pause53 #pause 54 54 onerror {resume} 55 55 #Log all the objects in design. These will appear in .wlf file# 56 56 log -r /* 57 run -all 58 exit 59 57 60 #View sim_tb_top signals in waveform# 58 add wave sim:/tb_top/*61 #add wave sim:/tb_top/* 59 62 60 63 #Change radix to Hexadecimal# -
trunk/sw/uart.c
r33 r34 3 3 const long UART_BASE_ADR[1] = {0x800000FFF0C2C000}; 4 4 const int UART_BAUDS[1] = {0}; 5 const int BAUD_RATE =100000; 5 6 const int IN_CLK =50000000; 6 7 … … 59 60 long allone=0xffffffffffffffff; 60 61 int divisor; 61 float float_divisor;62 //float float_divisor; 62 63 /* Reset receiver and transmiter */ 63 64 REG8( UART_FCR ) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_14; … … 73 74 74 75 /* Set baud rate */ 75 float_divisor = (float) IN_CLK/(16 * UART_BAUDS[core]); 76 float_divisor += 0.50f; // Ensure round up 77 divisor = (int) float_divisor; 78 76 //float_divisor = (float) IN_CLK/(16 * UART_BAUDS[core]); 77 //float_divisor += 0.50f; // Ensure round up 78 //divisor = (int) float_divisor; 79 divisor = BAUD_RATE; 80 79 81 REG8(UART_BASE_ADR[core] + UART_LCR) |= UART_LCR_DLAB; 80 82 REG8(UART_BASE_ADR[core] + UART_DLL) = divisor & 0x000000ff;
Note: See TracChangeset
for help on using the changeset viewer.