Skip to content

Commit

Permalink
Update following git fail
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-xmos committed Aug 20, 2013
1 parent 24df9fe commit 8a3d892
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 128 deletions.
Binary file modified app_uart_fast/.DS_Store
Binary file not shown.
Empty file modified app_uart_fast/.cproject
100755 → 100644
Empty file.
Empty file modified app_uart_fast/.project
100755 → 100644
Empty file.
22 changes: 11 additions & 11 deletions app_uart_fast/.settings/org.eclipse.cdt.core.prefs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#Wed Jul 10 12:56:12 BST 2013
#Fri Jul 12 11:56:06 BST 2013
eclipse.preferences.version=1
environment/project/com.xmos.cdt.toolchain.2069624891/XMOS_MODULE_PATH/delimiter=\:
environment/project/com.xmos.cdt.toolchain.2069624891/XMOS_MODULE_PATH/operation=append
environment/project/com.xmos.cdt.toolchain.2069624891/XMOS_MODULE_PATH/value=
environment/project/com.xmos.cdt.toolchain.2069624891/append=true
environment/project/com.xmos.cdt.toolchain.2069624891/appendContributed=true
environment/project/com.xmos.cdt.toolchain.710265276/XMOS_MODULE_PATH/delimiter=\:
environment/project/com.xmos.cdt.toolchain.710265276/XMOS_MODULE_PATH/operation=append
environment/project/com.xmos.cdt.toolchain.710265276/XMOS_MODULE_PATH/value=
environment/project/com.xmos.cdt.toolchain.710265276/append=true
environment/project/com.xmos.cdt.toolchain.710265276/appendContributed=true
environment/project/com.xmos.cdt.toolchain.1095209910/XMOS_MODULE_PATH/delimiter=\:
environment/project/com.xmos.cdt.toolchain.1095209910/XMOS_MODULE_PATH/operation=append
environment/project/com.xmos.cdt.toolchain.1095209910/XMOS_MODULE_PATH/value=
environment/project/com.xmos.cdt.toolchain.1095209910/append=true
environment/project/com.xmos.cdt.toolchain.1095209910/appendContributed=true
environment/project/com.xmos.cdt.toolchain.2051310469/XMOS_MODULE_PATH/delimiter=\:
environment/project/com.xmos.cdt.toolchain.2051310469/XMOS_MODULE_PATH/operation=append
environment/project/com.xmos.cdt.toolchain.2051310469/XMOS_MODULE_PATH/value=
environment/project/com.xmos.cdt.toolchain.2051310469/append=true
environment/project/com.xmos.cdt.toolchain.2051310469/appendContributed=true
15 changes: 8 additions & 7 deletions app_uart_fast/README.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

Simple/Fast UART loopback Demo Application
==========================================
Simple Uart Loopback Example
============================

:scope: Example
:description: Usage Example for xSOFTip Fast/simple-UART Module
:keywords: Serial simple fast UART demo
:boards: XP-SKC-L16
:description: Application to demonstrate module_uart_fast_rx and module_uart_fast_tx running looped back on a single Slicekit core board
:keywords: UART, demo
:boards: XA-SKC-L2

This application instantiates both the module_uart_fast_rx and module_uart_fast_tx components looped back to one another to demonstrate basic usage. It will be necessary to setup two connections on the 0.1" testpoints on the Slicekit core board prior to running the demo. See quick start for details


Demonstration application showing loopback of the RX and TX UART components.
Binary file modified app_uart_fast/doc/.DS_Store
Binary file not shown.
27 changes: 14 additions & 13 deletions app_uart_fast/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
#include "uart_tx.h"

#define TEST_LENGTH 32 //number of characters to send/receive in test. Max 256.
#define BIT_PERIOD 10 //bit period in clock ticks. CLKBLK_REF is 100MHz here
//so 10 x 10ns = 100ns per bit period -> 10MHz baudrate
#define DEMO_TILE 0 //xCore tile to run the demo on
#define BIT_PERIOD 868 //bit period in clock ticks. CLKBLK_REF is 100MHz here
//so 10 x 10ns = 100ns per bit period -> 10MHz baudrate
//The maximum number here is 2^16 or 65535 due to 16b port timers
#define DEMO_TILE 1 //xCore tile to run the demo on

//:: Port and clock declarations
on tile[DEMO_TILE]: in port p_rx = XS1_PORT_1E; //XD12
on tile[DEMO_TILE]: out port p_tx = XS1_PORT_1F; //XD13
on tile[DEMO_TILE]: in port p_rx = XS1_PORT_1E; //XD12
on tile[DEMO_TILE]: out port p_tx = XS1_PORT_1F; //XD13
on tile[DEMO_TILE]: const clock refClk = XS1_CLKBLK_REF; //Use 100MHz reference clock
//::

Expand Down Expand Up @@ -64,14 +65,14 @@ int main(void) {

//Configure ports to be clocked from specified clock source and initialis
par {
on tile[DEMO_TILE]: {
uart_tx_fast_init(p_tx, refClk);
uart_tx_fast(p_tx, c_producer_to_tx, BIT_PERIOD);
}
on tile[DEMO_TILE]: {
uart_rx_fast_init(p_rx, refClk);
uart_rx_fast(p_rx, c_rx_to_consumer, BIT_PERIOD);
}
on tile[DEMO_TILE]: {
uart_tx_fast_init(p_tx, refClk);
uart_tx_fast(p_tx, c_producer_to_tx, BIT_PERIOD);
}
on tile[DEMO_TILE]: {
uart_rx_fast_init(p_rx, refClk);
uart_rx_fast(p_rx, c_rx_to_consumer, BIT_PERIOD);
}
on tile[DEMO_TILE]: produce(c_producer_to_tx);
on tile[DEMO_TILE]: consume(c_rx_to_consumer);
}
Expand Down
Binary file modified module_uart_fast_rx/.DS_Store
Binary file not shown.
29 changes: 7 additions & 22 deletions module_uart_fast_rx/README.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
<Add title here>
================

Simple/Fast UART RX component
=============================
:scope: <Put one of Roadmap, Example, Early Development or General Use>
:description: <Add one line here>
:keywords: <Add comma separated list of keywords>
:boards: <Add comma separated list of supported boards>

:scope: Early Development
:description: Basic and fast UART without FIFO
:keywords: Serial simple fast UART
:boards: XP-SKC-L16

This is a single logical core, fast UART RX component suitable for high speed applications. It uses a core per rx or tx channel but is able to stream continuously at up to 10Mbps, using a 62.5MIPS core

Features
--------

* Single core implementation
* Fixed 1, 8, n, 1 configuration
* No FIFO
* High speed
* Baud rate specified as a bit period in multiples of 10ns

Known Issues
------------

* None
<Add description of software block>
10 changes: 5 additions & 5 deletions module_uart_fast_rx/module_uart_fast_rx.metainfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
componentName = "Simple UART RX"
componentFullName = ""
alternativeNames = { }
componentDescription = "Stripped down very simple, fast UART RX with limited features"
componentVersion = "1v1"
componentDescription = "Stripped down very simple, fast Uart RX with limited features"
componentVersion = "1v0"

-------------------------------------------------------------------------------
-- Parameter descriptions.
Expand All @@ -29,7 +29,7 @@ channels = {
c_rx_uart = {
short = "RX channel",
type = "streaming",
long = "Channel for the client to input RX data from the Uart receiver",
long = "Channel for the client to send RX data to the Uart transmitter",
help = "",
}
}
Expand All @@ -49,10 +49,10 @@ generatedCode = {
"uart_rx.h"
},
globals = [[
in port p_uart${swblock.id}_rx = XS1_PORT_1E;
in port p_uart${swblock.id}_rx = XS1_PORT_1A;
]],
body = [[
uart_rx_fast(p_uart_rx, c_rx_uart, 10); //10x10ns = 100ns bit period
uart_rx_fast(p_uart_rx, c_rx_uart, 100);
]]
}

Empty file modified module_uart_fast_rx/src/uart_rx.h
100644 → 100755
Empty file.
9 changes: 5 additions & 4 deletions module_uart_fast_rx/src/uart_rx.xc
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

void uart_rx_fast_init(in port p, const clock clkblk){
//set port into clocked mode
configure_in_port_no_ready(p, clkblk);
//clear the receive buffer
configure_in_port_no_ready(p, clkblk);
//clear the receive buffer
clearbuf(p);
}

Expand All @@ -24,11 +24,12 @@ void uart_rx_fast(in port pIn, streaming chanend cOut, int clocks) {
#pragma loop unroll(8)
for(int i = 0; i < 8; i++) {
pIn @ t :> >> data; //sample value when port timer = t
//includes post right shift
//inlcudes post right shift
t += dt;
}
data >>= 24; //shift into MSB
data >>= 24; //shift into MSB
cOut <: (unsigned char) data; //send to client
pIn @ t :> int _;
data = 0;
}
}
Expand Down
Binary file modified module_uart_fast_tx/.DS_Store
Binary file not shown.
29 changes: 7 additions & 22 deletions module_uart_fast_tx/README.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
<Add title here>
================

Simple/Fast UART TX component
=============================
:scope: <Put one of Roadmap, Example, Early Development or General Use>
:description: <Add one line here>
:keywords: <Add comma separated list of keywords>
:boards: <Add comma separated list of supported boards>

:scope: Early Development
:description: Basic and fast UART without FIFO
:keywords: Serial simple fast UART
:boards: XP-SKC-L16

This is a single logical core, fast UART TX component suitable for high speed applications. It uses a core per rx or tx channel but is able to stream continuously at up to 10Mbps, using a 62.5MIPS core

Features
--------

* Single core implementation
* Fixed 1, 8, n, 1 configuration
* No FIFO
* High speed
* Baud rate specified as a bit period in multiples of 10ns

Known Issues
------------

* None
<Add description of software block>
8 changes: 4 additions & 4 deletions module_uart_fast_tx/module_uart_fast_tx.metainfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
componentName = "Simple UART TX"
componentFullName = ""
alternativeNames = { }
componentDescription = "Stripped down very simple, fast UART TX with limited features."
componentVersion = "1v1"
componentDescription = "Stripped down very simple, fast Uart TX with limited features."
componentVersion = "1v0"

-------------------------------------------------------------------------------
-- Parameter descriptions.
Expand Down Expand Up @@ -49,10 +49,10 @@ generatedCode = {
"uart_tx.h"
},
globals = [[
out port p_uart${swblock.id}_tx = XS1_PORT_1F;
out port p_uart${swblock.id}_tx = XS1_PORT_1A;
]],
body = [[
uart_tx_fast(p_uart_tx, c_tx_uart, 10); //10x10ns = 100ns bit period
uart_tx_fast(p_uart_tx, c_tx_uart, 100);
]]
}

Empty file modified module_uart_fast_tx/src/uart_tx.h
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion module_uart_fast_tx/src/uart_tx.xc
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

void uart_tx_fast_init(out port p, const clock clkblk){
//set to clocked port, with initial value 1 (idle for UART)
configure_out_port_no_ready(p, clkblk, 1);
configure_out_port_no_ready(p, clkblk, 1);
}


Expand Down
Loading

0 comments on commit 8a3d892

Please sign in to comment.