5. Various digital modeling techniques such as algorithmic descriptions, finite state machine descriptions and Boolean equations can be modeled using this language [25].
4.1.2 VHDL
VHDL is a hardware description language which can be used to describe model for a digital hardware device. The digital system can be as simple as a logic gate or as complex as a complete digital electronic system. The basic building blocks of this language are called as design units of this language. There are four main design units in VHDL language to describe an entity (hardware abstraction of the digital system) [24] 1. Entity declaration. 2. Architecture declaration. 3. Configuration declaration. 4. Package (Package declaration and Package body). 5. Test-bench
The VHSIC Hardware Description Language (VHDL) is a formal notation intended for use in all phases of the creation of electronic systems. Because it is machine understandable as well as human understandable, it supports the synthesis, development, verification, and testing of hardware designs; the communication of hardware design data; modification, maintenance, procurement of hardware [24].
The main difference between VHDL and another programming language more widely used in computers for eg. C, is that VHDL enables the execution of concurrent statements. In contrast with a sequential statement, a concurrent statement is so called because conceptually it can be activated to perform its task together with any other concurrent statements [25].
VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 58
The design entity is the initial hardware abstraction in VHDL. It represent a part of a hardware design that has well defined inputs and outputs and performs a well defined function. Entity may represent system, a subsystem, a board, a chip, a cell, a logic gate [24]. A configuration can be used to describe how design entities are put together to form a complete design. An entity may be described in form of a hierarchy of blocks, which represents a portion of whole design. The top level block is the design entity itself; such a block is an external block that resides in a library and may be used as a component of design. [24].
a) Architectures
Architecture, continuing with the analogy of an IC, is equivalent to the internal electronic circuit that performs the function for which the component has been designed. At this stage all the signals the entity uses to communicate with the external world are defined and unalterable. Inside entity, in its place, the programmer can write any type of statements allowed by the VHDL syntax, like other components, representing sub-circuits, other signals, for connection, or processes, which has sequential statements operating on values. The purpose is to apply some operations to data on input ports and generate some results to assign to output ports [25].
b) Configurations
In the previous two subsections we saw that the same entity can be usefully described, unless the functional behaviors match, with different approaches that correspond to different architectures. Due to this, nothing prevents us from choosing architecture of an entity regardless of architectures chosen for other entities. The configuration declaration permits of assembling the system based on our goal, architectures availability. To explain this idea, let us assume we have n entities {E1,, En}. Let also suppose each of them has got two architectures, Ai 1 and Ai 2 with i in {1,,n}. If the entire system is only composed of all the entities {E1,,En}, combining the two architectures for each of them we can virtually have 2n different representation of the same system [26]. VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 59
c) Generic Parameters
The generic interface list is another powerful tool provided by VHDL language. Its aim is to allow parameterized descriptions of entities. In fact, from an architecture point of view, generic element can be seen as a constant whose visibility extends into the whole architecture body corresponding to that entity declaration [24]. The actual generic value, on the other hand, it can be defined in the entity that lies on a upper level in the hierarchy and is passed down to the component as a parameter [26].
VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 60
4.1.3 High Level Design Flow It is a design flow used to create a complex FPGA and ASIC devices [24]. The designer starts with a design specification, then creates an RTL report, verifies that report, synthesizes the report to gates, uses place and route tools to implement the design in the chip and verifies the final result is correct in terms of function and timing [24]. The high level design flow is illustrated in figure 3.1.
Design Specification
HDL Capture
RTL Simulation
RTL Synthesis
VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 61
After the design specification has been completed, the designer can begin the process of implementation. The designer firstly creates the VHDL description which describes the clock-by clock behaviour of the design. The VHDL code for entities of the design is entered. The designer then checks the design for any syntax errors in the design. When all syntax errors are removed, the VHDL code is verified for correctness by simulating it [24].
The RTL simulation step is used to verify the correctness of RTL VHDL description. In RTL Simulation, the designer uses stimulus that represents the design environment to drive the design and check to make sure that the result are correct. A standard VHDL simulator can be used to read the RTL VHDL description and verify the correctness of the design [24].
The objective of the VHDL Synthesis step is to create a design that implements the required functionality and matches the designers constraints in speed, area, or power. The VHDL synthesis tools convert the VHDL description into a net list in the target FPGA or ASIC technology. For the VHDL synthesis tool to perform this step properly, the VHDL code must be written in a particular style [26]. The designer reads the VHDL design into the VHDL synthesis tool. The synthesizer produces an output net list in the target technology and a number of report files to determine the quality of the synthesis output [26].The most common output files are the timing report and the area report. Most synthesis tools produce a number of other reports which are hierarchy reports, instances reports, nets reports, power reports, and others but the most useful reports initially are the timing reports, as these are usually the most critical factors. VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 62
Some designers might want to do a quick check on the output of the synthesis tool to make sure that the synthesis tool produced a functionally correct design. For doing this the designer executes a functional gate level verification. The designer reads the output VHDL net list from the synthesis tool and a library of the synthesis primitives into the VHDL simulator and then runs the simulation using the RTL Verification vectors. After running the simulation, if the design matches then the synthesis tool did not produce logic mismatches but if it does not match, the designer needs to debug the VHDL RTL description to see what is wrong [24].
Place and route tools are used to take the design net list and implement the design in the target technology device. The place and route tools are used to place each primitive from the net list into an appropriate location on the target device and then route signals between the primitives to connect the devices according to the net list of the design [25]. One input to the place and route tools is the net list in EDIF or in another format of net list. For some place and route tools the another input is the timing constraints, for giving the place and route tools an indication about the signals that which have critical timing associated with them and to route these nets in the most efficient manner of timing [24]. Typically these nets are identified during the static timing analysis process during synthesis. These constraints tell the place and route tool to place the primitives in close proximity to one another and to use VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 63
After the place and route process has completed, the designer will want to verify the results of the place and route process. There are a number of methods to accomplish this task but the most common method is to use post route gate level simulation. This post layout timing simulation combines the net list used for place and route with the timing file from the place and route process into a simulation that checks both functionality and timing of the design.
VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 64
The necessary operation of a state machine is twofold: 1. It traverses through a sequence of states, where the after that state is determined by next state decoder, depending upon the present state as well as input conditions [27]. 2. It provides sequences of output signals based upon state transitions [27]. The transitions from one state to another are called control sequencing and the logic necessary for deciding the next states is called the transition function [27]. The utilization of VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 65
VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 66
4.2
Edition 10.1C (MXE) tool will be used for functional simulation and logic verification at each block level and system level. The Xilinx Synthesis Technology (XST) of Xilinx ISE tool will be used for synthesis of transmitter and receiver on FPGA. In DS CDMA transmission user data is spread by a PN sequence then modulated using DPSK modulation. Then the modulated signals from different users are combined and transmitted. In the receiver end we demodulated the data using DPSK demodulator then recover the traffic channel information and detecting original data. In Our project, the following specifications are considered for design and implementation of the MAC Based DS-SS CDMA Forward link Tx and Rx frame for Ad-hoc network.
Table 4.1 Following specification is considered for Design & Implementation for MAC based DS-SS CDMA Forward link for Ad-hoc Network
Type of PN sequence Gold code
Walsh code
N x N matrix
VHDL
Virtex 5
Synthesis software
Xilinx 14.1
Simulation
Modelsim 14.1c
VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 67
VHDL Implementation of DS-SS CDMA based Mac protocol for Ad-hoc Networks 68