Atom (programming language)

Last updated
Atom
Paradigm Functional, synchronous, reactive
Family Haskell
Designed by Thomas Hawkins
First appeared2007;16 years ago (2007)
Stable release
1.0.13 / November 13, 2021;2 years ago (2021-11-13)
Typing discipline static, strong
OS Cross-platform
License BSD3
Website hackage.haskell.org/package/atom
Influenced by
Bluespec, Confluence, Haskell

Atom is a domain-specific language (DSL) in Haskell, for designing real-time embedded software.

Contents

History

Originally intended as a high-level hardware description language (HDL), Atom was created in early 2007 and released as free and open-source software (FOSS) of April of that year. [1] Inspired by TRS [2] and Bluespec, Atom compiled circuit descriptions, that were based on guarded atomic operations, or conditional term rewriting, into Verilog netlists for simulation and logic synthesis. As a hardware compiler, Atom's main objective is to maximize the number of operations, or rules, that can execute in a given clock cycle without violating the semantics of atomic operation. By employing the properties of conflict-free and sequentially composable rules, [2] Atom reduced maximizing execution concurrency to a feedback arc set optimization of a rule-data dependency graph. This process was similar to James Hoe's original algorithm. [2]

When Atom's author switched careers in late 2007, from logic design to embedded system software engineering, Atom was redesigned from an HDL to a domain-specific language targeting hard real-time computing embedded applications. As a result, Atom's compiler's main objective changed from maximizing rule concurrency to balancing processing load and minimizing worst case timing latency. In September 2008, Atom was presented at the Commercial Users of Functional Programming (CUFP) conference. [3] In April 2009, in its new form, it was released as FOSS. [4]

Overview

Atom is a concurrent programming language intended for embedded applications. Atom features compile time task scheduling and generates code with deterministic execution time and memory use, simplifying worst case execution time analysis for applications that need hard realtime performance. Atom's concurrency model is that of guarded atomic actions, which eliminates the need for, and the problems of using, mutex locks.

By removing runtime task scheduling and mutex locking, two services traditionally served by a real-time operating system (RTOS), Atom can eliminate the need and overhead of an RTOS in embedded applications.

Limits

To provide guarantees of deterministic execution time and memory consumption, Atom places several restrictions on computing. First, Atom designs are always finite state: all variables are global and declared at compile time and dynamic memory allocation is disallowed. Second, Atom provides no function or looping constructs. Instead, state variable updates are pure combinational logic functions of the current state.

Related Research Articles

A real-time operating system (RTOS) is an operating system (OS) for real-time computing applications that processes data and events that have critically defined time constraints. A RTOS is distinct from a time-sharing operating system, such as Unix, which manages the sharing of system resources with a scheduler, data buffers, or fixed task prioritization in a multitasking or multiprogramming environment. Processing time requirements need to be fully understood and bound rather than just kept as a minimum. All processing must occur within the defined constraints. Real-time operating systems are event-driven and preemptive, meaning the OS can monitor the relevant priority of competing tasks, and make changes to the task priority. Event-driven systems switch between tasks based on their priorities, while time-sharing systems switch the task based on clock interrupts.

<span class="mw-page-title-main">Thread (computing)</span> Smallest sequence of programmed instructions that can be managed independently by a scheduler

In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system. In many cases, a thread is a component of a process.

Thread safety is a computer programming concept applicable to multi-threaded code. Thread-safe code only manipulates shared data structures in a manner that ensures that all threads behave properly and fulfill their design specifications without unintended interaction. There are various strategies for making thread-safe data structures.

<span class="mw-page-title-main">Embedded system</span> Computer system with a dedicated function

An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is embedded as part of a complete device often including electrical or electronic hardware and mechanical parts. Because an embedded system typically controls physical operations of the machine that it is embedded within, it often has real-time computing constraints. Embedded systems control many devices in common use. In 2009, it was estimated that ninety-eight percent of all microprocessors manufactured were used in embedded systems.

In computer science, an abstract machine is a theoretical model that allows for a detailed and precise analysis of how a computer system functions. It is similar to a mathematical function in that it receives inputs and produces outputs based on predefined rules. Abstract machines vary from literal machines in that they are expected to perform correctly and independently of hardware. Abstract machines are "machines" because they allow step-by-step execution of programmes; they are "abstract" because they ignore many aspects of actual (hardware) machines. A typical abstract machine consists of a definition in terms of input, output, and the set of allowable operations used to turn the former into the latter. They can be used for purely theoretical reasons as well as models for real-world computer systems. In the theory of computation, abstract machines are often used in thought experiments regarding computability or to analyse the complexity of algorithms. This use of abstract machines is fundamental to the field of computational complexity theory, such as finite state machines, Mealy machines, push-down automata, and Turing machines.

In computer engineering, a hardware description language (HDL) is a specialized computer language used to describe the structure and behavior of electronic circuits, and most commonly, digital logic circuits.

<span class="mw-page-title-main">System on a chip</span> Micro-electronic component

A system on a chip or system-on-chip is an integrated circuit that integrates most or all components of a computer or other electronic system. These components almost always include on-chip central processing unit (CPU), memory interfaces, input/output devices and interfaces, and secondary storage interfaces, often alongside other components such as radio modems and a graphics processing unit (GPU) – all on a single substrate or microchip. SoCs may contain digital and also analog, mixed-signal and often radio frequency signal processing functions.

<span class="mw-page-title-main">Embedded operating system</span> Type of computer operating system

An embedded operating system is an operating system for embedded computer systems. Embedded operating systems are a computer system designed to increase functionality and reliability for achieving a specific task. Depending on the method used for Computer multitasking, this type of operating system might be considered a real-time operating system (RTOS).

In computer science, a lock or mutex is a synchronization primitive that prevents state from being modified or accessed by multiple threads of execution at once. Locks enforce mutual exclusion concurrency control policies, and with a variety of possible methods there exists multiple unique implementations for different applications.

Nios II is a 32-bit embedded processor architecture designed specifically for the Altera family of field-programmable gate array (FPGA) integrated circuits. Nios II incorporates many enhancements over the original Nios architecture, making it more suitable for a wider range of embedded computing applications, from digital signal processing (DSP) to system-control.

The MicroBlaze is a soft microprocessor core designed for Xilinx field-programmable gate arrays (FPGA). As a soft-core processor, MicroBlaze is implemented entirely in the general-purpose memory and logic fabric of Xilinx FPGAs.

In computer science, the fetch-and-add (FAA) CPU instruction atomically increments the contents of a memory location by a specified value.

<span class="mw-page-title-main">FreeRTOS</span> Real-time operating system

FreeRTOS is a real-time operating system kernel for embedded devices that has been ported to 35 microcontroller platforms. It is distributed under the MIT License.

Concurrent computing is a form of computing in which several computations are executed concurrently—during overlapping time periods—instead of sequentially—with one completing before the next starts.

Impulse C is a subset of the C programming language combined with a C-compatible function library supporting parallel programming, in particular for programming of applications targeting FPGA devices. It is developed by Impulse Accelerated Technologies of Kirkland, Washington.

C to HDL tools convert C language or C-like computer code into a hardware description language (HDL) such as VHDL or Verilog. The converted code can then be synthesized and translated into a hardware device such as a field-programmable gate array. Compared to software, equivalent designs in hardware consume less power and execute faster with lower latency, more parallelism and higher throughput. However, system design and functional verification in a hardware description language can be tedious and time-consuming, so systems engineers often write critical modules in HDL and other modules in a high-level language and synthesize these into HDL through C to HDL or high-level synthesis tools.

<span class="mw-page-title-main">XtratuM</span> Hypervisor

XtratuM is a bare-metal hypervisor specially designed for embedded real-time systems available for the instruction sets LEON2/3/4, ARM v7 and V8 processors and RISC V processor.

<span class="mw-page-title-main">OpenComRTOS</span> Real-time operating system

OpenComRTOS is a commercial network-centric, formally developed real-time operating system (RTOS), aimed mainly at the embedded system market.

PX5 RTOS is a real-time operating system (RTOS) designed for embedded systems. It is implemented using the ANSI C programming language.

References

  1. ANN: Atom: Yet another Haskell HDL (Report).
  2. 1 2 3 Hoe, James C.; Arvind (November 2000). Synthesis of Operation-Centric Hardware Descriptions (PDF). International Conference on Computer Aided Design (ICCAD).
  3. "Controlling Hybrid Vehicles with Haskell". Archived from the original on 2008-07-04. Retrieved 2009-12-05.
  4. ANN: atom-0.0.2