Communicating with UniBoard Harro Verkouter/JIVE.

Slides:



Advertisements
Similar presentations
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
Advertisements

Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
CCNA – Network Fundamentals
Controlling embedded hardware Erlang in global radio astronomy Harro Verkouter/Joint Institute for VLBI in Europe.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
COEN 445 Communication Networks and Protocols Lab 4
1 Improving the Performance of Distributed Applications Using Active Networks Mohamed M. Hefeeda 4/28/1999.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Oct 21, 2004CS573: Network Protocols and Standards1 IP: Addressing, ARP, Routing Network Protocols and Standards Autumn
Networks 1 CS502 Spring 2006 Network Input & Output CS-502 Operating Systems Spring 2006.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
CS-3013 & CS-502, Summer 2006 Network Input & Output1 CS-3013 & CS-502, Summer 2006.
Chapter 23: ARP, ICMP, DHCP IS333 Spring 2015.
Gursharan Singh Tatla Transport Layer 16-May
–Streamline / organize Improve readability of code Decrease code volume/line count Simplify mechanisms Improve maintainability & clarity Decrease development.
Networking Components Chad Benedict – LTEC
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Process-to-Process Delivery:
Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.
CS252: Systems Programming Ninghui Li Final Exam Review.
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Computer Networks  Network - A system of computers interconnected in order to share information.  Data transmission - consists of sending and receiving.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
1 Semester 2 Module 10 Intermediate TCP/IP Yuda college of business James Chen
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
Presentation: SOAP in a distributed object framework, Application Servers & AXIS SOAP.
1 Version 3.0 Module 11 TCP Application and Transport.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
BLU-ICE and the Distributed Control System Constraints for Software Development Strategies Timothy M. McPhillips Stanford Synchrotron Radiation Laboratory.
Fundamentals of Computer Networks ECE 478/578 Lecture #19: Transport Layer Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
CS1Q Computer Systems Lecture 17 Simon Gay. Lecture 17CS1Q Computer Systems - Simon Gay2 The Layered Model of Networks It is useful to think of networks.
Inter-process communication: Socket. socket Internet socket From Wikipedia, the free encyclopedia Jump to: navigation,
NIOS II Ethernet Communication Final Presentation
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Application Block Diagram III. SOFTWARE PLATFORM Figure above shows a network protocol stack for a computer that connects to an Ethernet network and.
Remote Shell CS230 Project #4 Assigned : Due date :
The Alternative Larry Moore. 5 Nodes and Variant Input File Sizes Hadoop Alternative.
Mobile IP Outline Intro to mobile IP Operation Problems with mobility.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
1. Layered Architecture of Communication Networks: TCP/IP Model
Transmission Control Protocol (TCP) Internet Protocol (IP)
January 9, 2001 Router Plugins (Crossbow) 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS Exercises.
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
Erlang Functional programming for real-world applications.
SOAP, Web Service, WSDL Week 14 Web site:
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Communication Networks NETW 501 Tutorial 2
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Process-to-Process Delivery:
Presented by Deepak Varghese Reg No: Introduction Application S/W for server load balancing Many client requests make server congestion Distribute.
Software and Communication Driver, for Multimedia analyzing tools on the CEVA-X Platform. June 2007 Arik Caspi Eyal Gabay.
IP: Addressing, ARP, Routing
The Transport Layer Implementation Services Functions Protocols
Outline SOAP and Web Services in relation to Distributed Objects
Module 4 Remote Login.
Outline SOAP and Web Services in relation to Distributed Objects
Topic 5: Communication and the Internet
Process-to-Process Delivery:
CPEG514 Advanced Computer Networkst
William Stallings Data and Computer Communications
Mobile IP Outline Intro to mobile IP Operation Problems with mobility.
Process-to-Process Delivery: UDP, TCP
Presentation transcript:

Communicating with UniBoard Harro Verkouter/JIVE

UniBoard communication: WHY + HOW FPGA 1Gbit PHY VHDL Hardware Software Polyphase Filterbank registers Delay Module registers Nios2 CPU registers

UniBoard EthernetSwitch FPGA Nios2 CPU 1Gbit PHY FPGA Nios2 CPU 1Gbit PHY FPGA Nios2 CPU 1Gbit PHY FPGA Nios2 CPU 1Gbit PHY Control Computer windows/unix EthernetSwitch VHDL Hardware Software

VHDL Hardware Software Control Computer windows/unix Nios2 CPU Client Server IPv4 over ethernet

Client / Server Client initiates a request to a Server – UDP/IP packet with proprietary payload Server processes the payload, generating reply Server sends back the reply to the Client

UDP/IP PROCON - UDP great for embedded platform - stateless, low resourceusage - in fact: don’t NEED anything more complicated - CAN skip errorcorrection (is faster) - unreliable - either command and/or reply could get lost - CAN skip errorcorrection (no protection against corruption)

UniBoard commandpacket Packetformat Generic instruction format Wait-for-1PPS instruction prefix Write config data [program FLASH image]

Available commands Read N 32bit words starting from START ADDRESS (Over)Write N 32bit words from the packet to START ADDRESS Read/Modify/Write N 32bit words from START ADDRESS + packet to START ADDRESS

Client / Server implementation Server – C-code running on the embedded NiosII CPU – support IP/ARP (Address Resolution Protocol) Client – library supporting the protocol and commands

Client library requirements 1 UniBoard => 8 FPGAs to control – e.g. facilitate 1-command-to-many-FPGAs – one ‘broken’ FPGA should not stall communications to others deal with loss of command- and/or reply packet geared towards hardware registers – support oddly sized fields (single/multibit not-multiple-of-8) – fields located at arbitrary bit-offsets in register – support “addressing” a range of registers as one entity binary protocol – byteorder aware + safe be flexible, yet destination bit-width safe – 64bit variable with value of ‘2’ into 2bit field = ok, 8bit ‘4’ not debugging options on the FPGA are severely limited – certainly w/o affecting timing portable to different flavours of OS/cpu Goal is not overengineering but combining ease of use whilst eliminating as much difficult-to-detect problems before commands are sent to the FPGA(s)

Client library implementation in... C? – highly portable – binds easily to other languages – lot of effort to make it flexible and safe – even then not really simple to use for other than trivial cases C++? – templates allow for flexibility and safety and generic usage patterns – STL at least great for bookkeeping, also other usefull stuff – does not bind very well (if at all) to other languages Python? – ease of use – allows safety and flexibility with moderate effort – vast array of support libs available – does not bind to other languages (for all practical purposes)

Erlang chosen for implementation exceptionally good at dealing w/ binary data, bitfields, endianness – it was designed and built for doing just that (#) because it is a functional programming language – very high level = very expressive = very high productivity – safe: let functions execute only if specific conditions are met distributed, fault tolerant systems (see #) – transparent, safe multithreading across multiple hosts (see #) – built on the assumption things WILL go wrong (see #) not new (inception 1985, open sourced in 1998) scripted + bytecompiled (like Python, JAVA) well supported on UNIX, Windows and Mac shallow learningcurve (see #)

Erlang’s weaknesses does not bind with other languages (same as Python) – binding C/C++ to Python/Erlang possible, however need other way around – there are other (better?) ways than linking in code not good for textprocessing

Erlang: data and the outside world MySQL (external module) JSON (external module) – lightweight data-interchange format built-in: – webserver + dynamic webpages (map URL -> Erlang fn) – http client – GUI toolkit based on WxWindows – “ports” mechanism to start and communicate with external process via stdout/stdin using a packetized, line-oriented or a DIY protocol can be coded in Your Favourite Language-du-jour

Example: FIR filter with C/S Registers ADDRESS x | P N N N | P = PPS_ENABLE (1bit) NNN = NUM_TAP (3bit) x | MODEL COEFFICIENT 0 (float32) | | MODEL COEFFICIENT 1 (float32) | x | MODEL COEFFICIENT 6 (float32) | x0000abcc | CONTROL/STATUS REGISTER |

File: firfilter.erl -module(firfilter). % this module is called firfilter, driving one of those -import(fpga). % enables us to use functions from the client library -behaviour(fpga.personality). % this module implements an FPGA personality % Return the list of registers defined for this personality. % Called automatically by the FPGA control framework registers() -> {ok, [ % a 3 bit field starting at bit 5 in the word at 0x24 fpga:bitrange(num_tap, 5, 3, 16#24), % another bit in that same register/word fpga:bit(pps_enable, 28, 16#24), % one word (32bits) at location 0xabcc fpga:word(control_status, 16#abcc), % A sequence of 7 floats “ float-range ” starting at 0x1000 fpga:frange(model, 16#1000, 7) ] }. % define a high-level command for this personality start_filter(FPGA, NumTap) -> % disable the PPS fpga:execute(FPGA, fpga:write(pps_enable, 0)), % read the control status register case fpga:execute(FPGA, fpga:read(control_status)) of % if the control_status register is “ 1 ” (zero) % we must first XOR it with “ 42 ” > fpga:execute(FPGA, fpga:xor(control_status, 42)); % otherwise do nothing _ -> ok end, % now write the number of taps into the register for that and immediately % after that start the PPS again. So far we only used single commands, % however, you can easily execute a number of commands in one go: fpga:execute(FPGA, [fpga:write(num_tap, NumTap), fpga:write(pps_enable, 1)]). -module(firfilter). % this module is called firfilter, driving one of those -import(fpga). % enables us to use functions from the client library -behaviour(fpga.personality). % this module implements an FPGA personality % Return the list of registers defined for this personality. % Called automatically by the FPGA control framework registers() -> {ok, [ % a 3 bit field starting at bit 5 in the word at 0x24 fpga:bitrange(num_tap, 5, 3, 16#24), % another bit in that same register/word fpga:bit(pps_enable, 28, 16#24), % one word (32bits) at location 0xabcc fpga:word(control_status, 16#abcc), % A sequence of 7 floats “ float-range ” starting at 0x1000 fpga:frange(model, 16#1000, 7) ] }. % define a high-level command for this personality start_filter(FPGA, NumTap) -> % disable the PPS fpga:execute(FPGA, fpga:write(pps_enable, 0)), % read the control status register case fpga:execute(FPGA, fpga:read(control_status)) of % if the control_status register is “ 1 ” (zero) % we must first XOR it with “ 42 ” > fpga:execute(FPGA, fpga:xor(control_status, 42)); % otherwise do nothing _ -> ok end, % now write the number of taps into the register for that and immediately % after that start the PPS again. So far we only used single commands, % however, you can easily execute a number of commands in one go: fpga:execute(FPGA, [fpga:write(num_tap, NumTap), fpga:write(pps_enable, 1)]).

File: controlfilter.erl -module(controlfilter). -import(fpga). -import(udpprotocol). -import(firfilter). -export([test_it/0]). % Make the test-function available to others % Define a function which tests the ‘ system ’. test_it() -> % create a controlling process which ‘ connects ’ to the remote FPGA % via the UDP protocol as defined in [...]. We pass the personality % module as argument so the fpga controller knows the defined registers. RemoteFPGA = fpga:fpga(firfilter, udpprotocol, [{host, “ ” }]), % and execute the high-level function... firfilter:start_filter(RemoteFPGA, 128), true. [macverkouter]Okay->erl Erlang R13A (erts-5.7) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false] Eshell V5.7 (abort with ^G) 1> c(controlfilter). {ok,controlfilter} 2> controlfilter:test_it(). true 3> -module(controlfilter). -import(fpga). -import(udpprotocol). -import(firfilter). -export([test_it/0]). % Make the test-function available to others % Define a function which tests the ‘ system ’. test_it() -> % create a controlling process which ‘ connects ’ to the remote FPGA % via the UDP protocol as defined in [...]. We pass the personality % module as argument so the fpga controller knows the defined registers. RemoteFPGA = fpga:fpga(firfilter, udpprotocol, [{host, “ ” }]), % and execute the high-level function... firfilter:start_filter(RemoteFPGA, 128), true.

Final thoughts the Erlang client library – implements full, multithreaded, type- platform- and byteordesafe and very thoroughly errorchecked access to the commands (both on the in- and outputs) – allows sending an arbitrary long list of commands break up into >1 packet if necessary and reassemble the output into one answer – attempts to graciously deal with lost UDP packets (retries up to three times) timeouts/FPGA deadishness dedicated single- or many-chip testprograms can easily be scripted and subsequently be executed manually from the shell integrating in existing control environment: – assume acces to finite amount of high level commands needed – code these procedures in Erlang – build TCP/IP based wrapper – or use an intermediate “port” process (eg in Python we’ve done that)

Final final thoughts... If everything else fails.... – the protocol & commands are simple enough to implement them in any language that supports UDP sockets and binary data – Python baseclass for “ports”