|
Written by Wesley Peck
|
|
Tuesday, 01 August 2006 |
Hthreads Overview
The hthread project is housed within the CSDL laboratory at ITTC. The long term goal of hthreads is
to allow a programmer to write a multi-threaded pthreads program, compile it, and have it run
effeciently on a hybrid CPU/FPGA chip. We believe the programmer should not be concerned with
where each thread runs, since with hthreads, a thread could run as either a software thread on the CPU
or run concurrently as a hardware thread in the FPGA. Rather, the programmer should only be concerned
with program correctness, freeing him or her from the technical details of hardware design.
Additionally, we want to drastically reduce overhead and jitter. To do this, we believe that the processor
should only be interrupted when there is a software thread that has a higher priority than the thread
currently running on the CPU. Furthermore, to increase the precision of real time scheduling, we want
the scheduling and thread management functionality migrated into the FPGA. This allows scheduling
decisions to be made before the system asks for them.
Our approach to providing these
new capabilities is to perform a hardware/software co-design of existing system components, and
extend the basic underlying policies of the multi-threaded programming model to threads that run within
the FPGA. We provide access to these new capabilities transparently through familiar API and system calls
that interact with our hardware through memory mapped registers. Significant system processing, which
used to require hundreds of assembler instructions, are now performed in tens of clock cycles with a
single memory transaction.
Advantages of Hthreads
There are many advantages to Hthreads over traditional operating systems, embedded operating systems,
and hybrid systems.
- Very low jitter. Many operating system functions, typcially implemented in software,
have been replaced by hardware circuits with deterministic execution times.
- Low context-switch overhead. Our scheduler runs as a hardware core, in parallel with CPU execution, and it is able to make scheduling decisions before the next context switch.
- Threads can run concurrently: time-multiplexing (pseudo-concurrently) on the CPU as a software thread or in parallel within the FPGA fabric as a hardware thread.
- Software threads and hardware threads can communicate and synchronize seamlessly. Both types of threads adhere to the same communication and synchronization policies.
- Hthreads programming is compatable with pthreads. This makes it easy for new developers, who are already familiar with pthreads, to develop applications for hthreads.
- It works! Hthreads does not just live on a simulator, but may be compiled and sythesized to Xilinx hybrid chips (FPGA + CPU).
What Makes Hthreads Unique?
Below is a block diagram of the hthread system during a mutex release operation. In typical systems,
steps A through E have to be done in software, preventing the CPU from doing useful work. In hthreads,
steps B through G are done in hardware, in parallel to the CPU.
Furthermore, in typical multi-threaded systems, when a set of threads are sharing resources to do a job,
creating new threads for pseudo-concurrency will not directly speed up the execution time. This is
depected below.
However, in hthreads, creating new hardware hthreads can produce a dramtic speedup. More hardware threads can be added, which run in true concurrency, to perform a job.
|
|
Last Updated ( Monday, 07 August 2006 )
|