System Design of RF Receiver and Digital Implementation of Control Logic
System Design of RF Receiver and Digital Implementation of Control Logic
LITH-ITN-ED-EX--03/008--SE
Marcus Ström
2003-04-09
Marcus Ström
_ ________________
Titel
System Design of RF Receiver and Digital Implementation of Control Logic
Författare
Marcus Ström
Sammanfattning
This report is the outcome of a thesis work done at Linköpings University, campus Norrköping. The thesis work was part of the development of a
RF transceiver chip for implantable medical applications. The development was done in cooperation with Zarlink Semiconductor AB, located in
Järfälla, Stockholm.
The transceiver is divided into three main blocks, which are the wakeup block, the MAC block and the RF block. The wakeup block is always
operating and is awaiting a wakeup request in the 2,45GHz ISM-band. The RF-block is operating in the 400MHz ISM-band and is powered up
after wakeup The MAC is the controller of the whole chip. All three blocks in the transceiver structure should be integrated on the same chip, using
TSMC 0,18µm process design kit for CMOS (Mixed Signal /RF).
The purpose of the thesis work was to develop the wakeup circuit for the transceiver. The main purpose was to develop the digital control logic in
the circuitry, using RTL-coding (mainly VHDL) but the thesis work also included a system analysis of the whole wakeup block, including the
front-end, for getting a better overview and understanding of the project.
A complete data packet or protocol for the wakeup message on 2,45GHz, is defined in the report and is one of the results of the project. The packet
was developed continuously during progress in the project. Once the data packet was defined the incoming RF stage could be investigated. The
final proposal to a complete system design for the wakeup block in the RF transceiver is also one of the outcomes of the project. The front-end
consists mainly of a LNA, a simple detector and a special decoder. Since the total power consumption on the wakeup block was set to 200nA, this
had to be taken under consideration continuously. There was an intention not to have an internal clock signal or oscillator available in the digital
part (for keeping the power consumption down). The solution to this was a self-clocking method used on the incoming RF signal. A special
decoder distinguishes the incoming RF signal concerning the burst lengths in time. The decoder consists of a RC net that is uploaded and then has
an output of 1, if the burst length is long enough and vice versa.
When it was decided to use a LNA in the front-end, it was found that it could not be active continuously, because of the requirements on low
power consumption. The solution to this was to use a strobe signal for the complete front-end, which activates it. This strobe signal was extracted
in the digital logic. The strobe signal has a specific duty cycle, depending on the time factors in the detector and in the decoder in the front-end.
The total strobing time is in the implemented solution 250µs every 0,5s.
The digital implementation of the control logic in the wakeup block was made in VHDL (source code) and Verilog (testbenches). The source code
was synthesized against the component library for the process 0,18µm from TSMC, which is a mixed/signal and RF process. The netlist from the
synthesizing was stored as a Verilog file and simulated together with the testbenches using the simulator Verilog-XL. The results from the
simulations were examined and reviewed in the program Simvison from Cadence. The result was then verified during a pre-layout review together
with colleagues at Zarlink Semiconductor AB. During the implementation phase a Design report was written continuously and then used for the
pre-layout review. Extracts (source code and testbench) from this document can be found as appendixes to the report.
Nyckelord
Transceiver, receiver, RF, telemetry, modulation, coding, system design, digital implementation, VHDL, Verilog, RTL, low power consumption,
LNA, detector and decoder.
Abstract
Abstract
This report is the outcome of a thesis work done at Linköping University, campus
Norrköping. The thesis work was part of the development of a RF transceiver chip for
implantable medical applications. The development was done in cooperation with
Zarlink Semiconductor AB, located in Järfälla, Stockholm.
The transceiver is divided into three main blocks, which are the wakeup block, the
MAC block and the RF block. The wakeup block is always operating and is awaiting a
wakeup request in the 2.45 GHz ISM-band. The RF-block is operating in the 400MHz
ISM-band and is powered up after wakeup The MAC is the controller of the whole
chip. All three blocks in the transceiver structure should be integrated on the same
chip, using TSMC 0,18µm process design kit for CMOS (Mixed Signal / RF).
The purpose of the thesis work was to develop the wakeup circuit for the transceiver.
The main purpose was to develop the digital control logic in the circuitry, using RTL-
coding (mainly VHDL) but the thesis work also included a system analysis of the
whole wakeup block, including the front-end, in order to get a better overview and
understanding of the project.
A complete data packet or protocol for the wakeup message on 2.45 GHz is defined in
the report and is one of the results of the project. The packet was developed
continuously during progress in the project. Once the data packet was defined the
incoming RF stage could be investigated.
The final proposal to a complete system design for the wakeup block in the RF
transceiver is also one of the outcomes of the project. The front-end consists mainly of
an LNA, a simple detector and a special decoder. Since the total power consumption
on the wakeup block was set to 200nA, this had to be taken under consideration
continuously. There was an intention not to have an internal clock signal or oscillator
available in the digital part (to keep the power consumption down). The solution to
Abstract
this was a self-clocking method used on the incoming RF signal. A special decoder
distinguishes the incoming RF signal concerning the burst lengths in time. The
decoder consists of a RC net that is uploaded and then has an output of 1, if the burst
length is long enough and vice versa.
When it was decided to use an LNA in the front-end, it was found that it could not be
active continuously, because of the requirements for low power consumption. The
solution to this was to use a strobe signal for the complete front-end, with which it is
activated. This strobe signal was extracted in the digital logic. The strobe signal has a
specific duty cycle, depending on the time factors in the detector and in the decoder in
the front-end. The total strobing time is in the implemented solution 250µs every 0,5s.
The digital implementation of the control logic in the wakeup block was made in
VHDL (source code) and Verilog (testbenches). The source code was synthesized
against the component library for the process 0,18µm from TSMC, which is a mixed
signal and RF process. The netlist from the synthesizing was stored as a Verilog file
and simulated together with the testbenches using the simulator Verilog-XL. The
results from the simulations were examined and reviewed in the program Simvision
from Cadence. The result was then verified during a pre-layout review together with
colleagues at Zarlink Semiconductor AB. During the implementation phase a Design
report was written continuously and then used for the pre-layout review. Extracts in
form of the source code and the testbench from this document can be found as
appendix B, respectively appendix C to this report.
Preface
Preface
This report is the result of the author’s thesis work performed at Zarlink
Semiconductor AB in Järfälla, Stockholm. It was performed at the department Medical
Applications and constitutes the final element of a Master of Science exam in
Electronics Design at the University of Linköping at Campus Norrköping.
The work was performed at Zarlink Semiconductor AB during the autumn and winter
2002-2003, under supervision of Per-Olof Bergstedt and Magnus Sneitz. I really want
to thank these people plus Tony Ohlsson at the company and of course my examiner
Qin-Zhong Ye at the Institution of Science and Technology (ITN) at Campus
Norrköping. Without their support this work would never have reached this final
result.
Contents
Table of contents
APPENDIX A ABBREVIATIONS.................................................................................. 61
APPENDIX C TESTBENCH........................................................................................... 73
Figures
Table of figures
1 General introduction
This report is the outcome of a thesis work done at Linköping University. The thesis
work was part of the development of a RF transceiver chip for implantable medical
applications. The development was done in cooperation with Zarlink Semiconductor
AB, located in Järfälla, Stockholm. The system architecture was predefined and can be
described as below in Figure 1.
-9-
Chapter 1
The main markets are products in the area of telemetry and implantable medical
applications.
The complete system will consist of a base station that communicates with one or
several implants as seen in Figure 1. The base station consists of a 2.45 GHz antenna
(A3), an 400 MHz antenna (A2), a RF PCB with the RF transceiver chip bonded to it
and a 2.45 GHz transmitter circuitry attached. An application PCB with a base station
chip or a direct interface to a PC or PDA and a battery power supply or feed from PC
or PDA is also needed. The implant consists of an RF PCB with the same RF
transceiver chip, a combined 400MHz/ 2450MHz patch antenna, the implant
application chip and a battery power supply.
The RF Transceiver chip shall be configured for operation on the implant side but also
for the base station side. The transceiver is divided into three main blocks, which are
the wakeup block, the MAC block and the RF block. The wakeup block is always
operating and is awaiting a wakeup request in the 2.45 GHz ISM-band (this function
disconnected when operating as a base station). The RF-block is operating in the
400MHz ISM-band and is powered up after wakeup or directly in the base station
application. The MAC is the controller of the whole chip and if serving as a base
station also controlling the external 2.45 GHz transmitter. All three blocks in the
transceiver structure should be integrated on the same chip, using TSMC 0,18µm
process design kit for CMOS (Mixed Signal / RF).
During the thesis work a requirement specification was written for the complete
wakeup block and a design report was written for the digital implementation. These
documents were done for documentation purpose at Zarlink Semiconductor AB. Most
of the contents of these documents are found in the report but some parts were
confidential and were therefore excluded. The design report included the source code
and the testbenches, which are found in this report as appendixes.
- 10 -
General Introduction
the report. This part is mainly dealing with terms like telemetry and radio
communication. Within these areas there are parts like modulation, demodulation,
error detection and coding techniques. This part is necessary as an introduction to the
area of low power and RF design.
The second part is the system analysis, which describes the development of the
wakeup block. It describes some of the problems that came up during the research
phase and describes and motivates the different choices made. Continuously during the
work, new information and approaches were discussed, mainly with people at Zarlink
Semiconductor.
In the final part, the implementation, the work with the RTL-coding, simulation and
verification are described and presented. The actual implementation work is described
and each sub block in the design are presented and described at a behavioral level. The
simulation procedure is described and extracts showing simulations results are
presented.
The actual RTL-code (in VHDL) is found in Appendix B and the testbench (in
Verilog) is found in Appendix C. Appendix A is just a compilation of all abbreviations
used in the report and is most functional to use as a reference list.
- 11 -
Theory
2 Theory
The theory chapter describes relevant and adequate information for the project, which
can be useful to read for better understanding of the rest of the report. If the reader
already is familiar with terms like telemetry, radio communication, modulation
techniques (including FSK, PSK and ASK) and error coding techniques like
Manchester encoding, Parity check and CRC it is not necessary to read this chapter.
Today’s system, in pacemaker for example, uses a low speed, very low distance
inductive communication system, that is limited to data rates of a few kilobits per
second at a decimeter range. An integrated RF-link on the other hand can offer much
higher data rates and communication distances up to some meters. If high data rates
are available together with applications like these, then there is a possibility to easily
download for example data statistics from a patient. Other usage areas could be for
example body-implanted sensors, which can communicate with each other over a
wireless RF transceiver solution.
- 13 -
Chapter 2
Programming Unit
Implanted
application
RF Link
Basestation
The development within radio communication using digital transmission leads towards
safer built systems with fewer errors in the transmission. When using digital
transmission the possibilities to control the data flow increases and, if wanted, include
correction of the transmitted data, which decreases the total amount of errors. [2], [5]
For transmitting a signal over the air, there are three main steps. First a pure carrier is
generated at the transmitter. In the modulation process the base band signal constitutes
the modulating signal and the higher frequency, the carriers signal as a sinusoidal
waveform. This modulation type is also sometimes called carrier wave (CW)
modulation. The following chapters will describe the most basic digital modulation
techniques, Amplitude-shift keying (ASK), Frequency-shift keying (FSK) and Phase-
shift keying (PSK). [2], [5], [6], [27], [28], [29], [30], [31]
- 14 -
Theory
ways to view or measure the same signal change. Amplitude and phase can also be
modulated simultaneously but this is difficult to generate and even more difficult to
detect.
The following chapters will only describe binary digital modulation techniques in
detail. This is done only to keep this theory as adequate to the project as possible and
as an introduction to these different techniques. There are of course other modulation-
techniques, like I/Q modulation etc. These techniques are just mentioned briefly under
each chapter. The thesis work was concentrated to (ultra) low power requirements and
therefore more complicated modulation techniques were unnecessary to investigate.
This because the more complicated the modulation is, the more complicated the
architecture of the transmitter and the receiver becomes, which means more power
consumption in reality. [1], [3], [4], [27], [28], [29], [30], [31]
- 15 -
Chapter 2
On/off keying (OOK) is the simplest ASK modulation where the transmission is either
on/off to represent 1/0. Hence, it is the special case of ASK modulation where no
carrier is present during the transmission of a zero. It is a non-coherent modulation
technique that represents a good compromise between power efficiency and bandwidth
efficiency and lends itself to a simple receiver structure. [1], [3], [4], [27], [28], [29]
- 16 -
Theory
A ∗ cos2πf 0 t , 0≤t ≤T
s (t ) =
A ∗ cos2πf 1t , elsewhere
Where A is a constant, f0 and f1 are the transmitted frequencies and T is the bit
duration.
FSK is used in many applications including cordless and paging systems. Some of the
cordless systems using this technique is DECT (Digital Enhanced Cordless Telephone)
and CT2 (Cordless Telephone 2). These systems are of course more complicated and
use more advanced types of FSK than Binary FSK. [1], [3], [4], [27], [28], [29]
When binary 1, Î φ = 0
- 17 -
Chapter 2
The main problem with BPSK is that the speed of data transmission is limited in a
given bandwidth. One way to increase the binary data rate without increasing the
bandwidth requirement is to encode more than one bit per phase change. The simplest
way to do this is Quadrature PSK (QPSK), where each symbol represents 2 bits.
- 18 -
Theory
To achieve greater efficiencies the number of bits per symbol must be increased even
more. If QPSK is generalized to more than four constellation points, it is known as M-
PSK, where M represents the number of constellation points. M is a power of 2 greater
than or equal to 8. Because of this increased bandwidth the price is reduced power
efficiency. [1], [3], [4], [27], [28], [29], [30]
Carrier modulation allows the transmission of modulating frequencies without the use
of transmission wire as mentioned before. However, for the communication process to
be completed or to be useful, the information or data must be recovered in its original
form at the receiving site. Each type of modulation is different and requires different
techniques to recover (demodulate) the information.
To detect and recover an OOK (On/Off Keyed) signal, a method of detecting the
presence or absence of RF oscillation is necessary. Demodulators that detect the
presence of RF oscillations and convert them into a recognizable form have a non-
complicated architecture and are therefore useful in low power constructions. [1], [3],
[5], [7], [8], [9]
- 19 -
Chapter 2
It can be seen that there are two bits of Manchester encoded data for each bit of
original data. The penalty for doing this is, is that Manchester encoded data consumes
double bandwidth. The coding can be seen as a synchronous clock encoding technique
used to encode the clock and data of a synchronous bit stream. The encoding may also
be alternatively viewed as a phase encoding where each bit is encoded by a positive 90
- 20 -
Theory
degree phase transition, or a negative 90 degree phase transition. The Manchester code
is therefore sometimes also known as a bi-phase code.
Given that a 0 encodes 10 and a 1 encodes 01, it follows that 00 and 11 are illegal
sequences or codes during the data information. These codes are sometimes used to
error check the data. It is possible to have the 8-bit not Manchester encoded “illegal
code” 11110000, which is an unlikely occurrence. This “illegal code” has the property
of having a DC component of zero and has one, 0 to 1 transition. This code can
therefore be used as a unique start sequence identifying the boundaries of a
Manchester encoded bit stream or data frame.
The mid-bit transition in Manchester code can serve as a clock as well as data. A low
to high transition represents a 1 and a high to low transition represents a 0. In so called
Differential Manchester (Figure 12) the mid-bit transition is used only to provide
clocking. Encoding of a 0 is represented by a transition at the beginning of a bit period
and a 1 is represented by the absence of a transition at the beginning of a bit period.
[1], [3], [7], [12], [13], [14], [23]
2.3.3 Checksum
Checksum is a traditional way of error detection. Checksum is using one’s
complement arithmetic for summation of the data packet. The sender calculates the
checksum (summation of all data blocks plus adding of a 1) and sends the one’s
complement of the checksum together with the original data. The receiver adds all
- 21 -
Chapter 2
incoming blocks as it receives them and adds a 1 at the end. If the total sum is not 0,
the receiver has detected an error. Note that sometimes the term checksum is used
generically to mean error detection for many methods. [1], [3], [15], [16], [23]
2.3.4 CRC
CRC or Cyclic Redundant Check is a strong method for detecting errors in data
communication. It is a polynomial that calculates a checksum for the data packet to be
sent. The transmitter sends this checksum at the end of the block and the receiver does
the same calculation of the incoming data with the same polynomial and compares this
with the incoming checksum. Depending on which polynomial chosen, the method is
more or less secure. CRC is used because it is very useful in detecting single bit errors,
multiple bit errors, and burst errors in data messages. An example of a CRC is CRC-
16, which uses the polynomial Gx = X16 +X15 +X2 + 1 (This polynomial is of degree
16). [3], [17], [18], [19], [20], [23]
- 22 -
System Analysis
3 System Analysis
The system analysis of the wakeup block in the RF transceiver was one of the two
main parts of the thesis work. This block/system was not defined at all and there were
many things to examine. One of the first things to investigate was how the data packet,
which should be sent as a wakeup signal on 2.45 GHz from a base station to an
implant, could be defined. Since the wakeup block is intended to be active during a
long time the requirement on total power consumption was set to maximum 200nA.
The incoming RF stage (also called front-end) needed to be investigated. For example,
in the beginning there was an approach of not having a low noise amplifier (LNA) in
this block, because of the low power requirements. This was later found to be
impossible, because the signal that was sent on the system was too weak for detection
without an LNA in the front-end. A question that came up was, how could this be
implemented and still have the same low power consumption?
More questions about how the awakening of the rest of the circuitry should be done
were also investigated. In the rest of the chip there are both analogue parts and digital
parts, which have different supply levels (vdd). Regulators for achieving these supply
levels must be implemented in the wakeup.
Early in the analysis part a requirement for not having an internal clock source in the
wakeup was determined. This requirement forced the wakeup block to include a
special solution with a decoder, which can extract a clock signal from the incoming RF
signal and use this as a self-clocking method. Later in the project, it was found that it
was necessary to have a clock signal for calculating the strobe time for the strobing of
the analogue front-end for keeping the power consumption as low as required. Despite
this, the external clock signal was decided not to be used for other purposes in the
digital logic, because in future products the strobe function may be excluded and then
the clock signal will be unnecessary and can be removed.
- 23 -
Chapter 3
• What information and how much data must be sent from the transmitter to the
wakeup circuitry?
• How will the receiver detect the RF signal with as low power consumption as
possible?
• What information and how much data are necessary to include in the data packet to
have a secure and safe wakeup of the circuitry?
• How will the transmitter distinguish between which receiver it wants to awake?
Out of these questions, an examination of how the data packet should be constructed
was done. There has been an extensive discussion about these questions during the
analysis phase of the thesis work.
The first approach was that in a data packet there must be some kind of start bits or
synchronization bits so the receiver to know that what is coming in is information and
not noise. The data that is sent to the receiver must also in this case contain some kind
of identification bits so the receiver knows that the transmitter wants to awake the
specific receiver, which receives the present RF signal at the moment.
The main purpose of the wakeup procedure was determined as this. The wakeup block
receives a code that provides information about on which channel the RF circuitry
shall initiate contact with the base station. The RF block shall answer on the 400MHz
ISM-band, which is divided into 10 different channels and therefore the implant needs
to know on which channel the base station is listening on. A first data packet was
defined (Figure 13):
- 24 -
System Analysis
The first approach was a kind of a standard structure of a data packet. It included a
preamble (start bits) for making it easier for the receiver to understand that a data
packet is on the way in. The preamble was later found unnecessary because this
receiver do not need these extra bits as a startup. The 24 synchronization bits were also
found unnecessary because it would be enough with a few bits as a unique start
sequence. When it later was decided to use Manchester encoding on the data, there
was an opportunity to have a unique start sequence that during data transmission can
not occur. Because of this a special pattern of 8 bits was created and replaced the old
preamble and synchronization bits. The approach with the application ID (26bits) was
used, but it was extended with a company code (8bits). This was done because there
was a need for the possibility to have more different ID’s for the applications inside a
specific company (which has the same company code).
With the extension of the number of bits for ID’s, from 26 bits to a total of 34 bits, the
number of ID’s increased from 226 = 67108864 to 234 =17179869184, which was more
satisfactory and suitable for the worldwide area of use. The Channel ID remained in
the data packet but was sent twice instead of having a checksum or CRC. This decision
was made because all bits without these 4 bits are checked against registers with the
correct bits. A CRC or checksum would therefore be superfluous and would work as a
double check, which only consumes power and time. The sum up was that the
checksum (or CRC) was removed and replaced by another transmission of the channel
ID. These two (4 bits long) channel ID’s are then compared to each other and therefore
checked against incorrectness. A new and second data packet was settled, which
included Manchester encoding (Figure 14).
- 25 -
Chapter 3
In order to get a secure and safe startup of the communication; the packet should start
with a unique start sequence. These bits are necessary and facilitate for the receiver to
understand that a packet is on the way. The start bits are in this case included in the
total data packet. Manchester encoding was introduced for the opportunity to have a
unique start sequence and a good error detection. The pattern 11110000 can never
appear during data transfer because of the Manchester encoding (see chapter
Manchester encoding on page 20). Hence, the start sequence is sent without
Manchester encoding and is therefore unique, compared to the rest of the sent data,
which are Manchester encoded.
After the start sequence, the actual information or data is sent. The data is transmitted
with Manchester encoding, as mentioned above; therefore the numbers of sent bits are
doubled for the data. This is where the information about which device the base station
wants to wakeup is sent. A company code, 8 bits long, and an application ID of 26 bits
identify this. When the correct company code and the correct application ID are
detected in the wakeup, it powers up the rest of the circuitry.
Later, during the analysis phase some details about the data packet were changed and
clarified. The first thing was the last bits, the channel ID. These bits were increased for
the opportunity of selecting more channels. This action was mainly settled for future
spin-off products to the design. It was also prolonged with 4 bits for band selection.
Totally the channel ID was increased to 12 bits and it was found that there was no
need for extra error detection on these bits in addition to the Manchester code already
applied.
The final definition of the data packet were also increased with the calculation of the
total amount of transmitted bits according to a special pattern consisting of short and
long burst length (for more information about this, see chapter The decoder on page
28). The final data packet definition is found in Figure 15 below. [1], [3], [4], [7], [12],
[13], [14]
- 26 -
System Analysis
The low power requirements on the receiver also made it hard to have a complicated
architecture on the detector. If the modulation is complicated and complex the
architecture of the receiver becomes more complex and with that comes more power
consumption. After examination of Binary ASK (BASK), Binary FSK (BFSK) and
Binary PSK (BPSK), it was found that the most non-complicated demodulation would
be the special case of BASK called On/Off Keying (OOK). This technique is the
simplest ASK modulation. The data transmission is either on/off (at 2.45 GHz in this
case) for representing 1/0. The demodulation or detection of OOK is very basic; the
receiver just needs to detect the presence or absence of the oscillation. Demodulators
that do this and convert the incoming signal into recognizable form are most suitable
for low power requirements on receivers. The architecture of this kind of detector is
very simple and can be described by the basic schematic in Figure 16.
- 27 -
Chapter 3
The schematic above includes a diode detector plus a comparator. The principle is that
the capacitor charges through the diode during positive half-cycles of the carrier for
binary data ‘1’, and discharges through the resistor for data ‘0’. The figure is an extract
from the requirement specification done for the wakeup block during the thesis work.
[2], [5], [7], [8], [9], [21], [22]
The solution to this problem was to implement a circuitry that can distinguish two
specified patterns from each other, depending on the time between the negative pulse
edges. The decoder may consist of an RC net that can distinguish these signals. The
incoming signal to the block consists of either short 0 followed by a short 1 or long 0
followed by long 1. Short and long are the time factors for the absence/presence of the
RF signal.
The data that flow into a block like this must consist of an OOK modulated signal. The
incoming signal shall also be used as the clock for its output. Hence, the incoming
signal is the clock signal to the output when these two flow into the digital circuitry. A
solution like this was examined and later used because of the requirements of, on low
power consumption. For viewpoint of power consumption, there was no possibility for
internal clock synchronization in the wakeup block as mentioned.
- 28 -
System Analysis
The time for an SL or LS packet to be sent is 0,5Xs (short 0) + 0,5Xs (short 1) + 1,5Xs
(long 0) + 1,5Xs (long 1) = 4Xs. The time 0,5X is a critical minimum time for the
comparator in the detector to let the signal pass through. The time 3Xs is the critical
time for the RC net in the special decoder to be able to let through a signal as a 1. If
the time is long enough to upload the RC net in the decoder it will put out a 1,
otherwise the signal into the digital part will be clocked as a 0. The time for an SL
packet to be sent is therefore 50 * 4Xs = 200Xs, plus some delay time. The total time
will be the same for an LS packet.
Since the issue with attenuation in body tissue was considered a big risk to the project,
it was decided that it was necessary to settle a field measurement for this. The purpose
of this measurement was to define the body attenuation of a 2.45 GHz signal. Effects
of different implantation depth were to be evaluated.
The result from the field measurements showed that the attenuation in human body
tissues at 2.45 GHz is about 7,9dB/22mm, which verifies the information the company
got from an internal source. Since the maximum output power on 2.45 GHz is set to
100mW, and the free space loss (on 2.45 GHz) at 2m distance is approximately 46dB.
Free space loss is actually the amount of attenuation of RF energy on an unobstructed
path between two isotropic antennas. Basically, it is the dilution of energy as the RF
- 29 -
Chapter 3
signal propagates away from a source. The free space loss can be calculated from the
equation below (EQ 1).
Free Space Loss = 20 Log10 (Frequency in MHz) + 20Log10 (Distance in Miles) + 36.6 (EQ 1)
At 2 meters (0,001243miles) distance the free space loss (attenuation) for 2.45 GHz is:
The conclusion was that an LNA was needed in the front-end in the wakeup block. Of
course this will depend on the range between the transmitter and the receiver, and at
this stage a maximum distance of 2 meters was set. [4], [6], [10], [11], [24]
The data packet that is sent from the base station to the implant unit is modulated with
OOK and is Manchester encoded. The transmitted data packet is twice as long (in bits
counted) as the received packet in the digital part. This is the effect of using the
mentioned special decoder block (from now on called wake_dec). This block decodes
different patterns consisting of different time variables concerning presence or absence
of the RF signal. These patterns and the explanation behind them are described further
in the chapter about the wake_dec and in the chapter about the data packet
The wakeup_a consists of an analogue front-end, which amplifies, detects and decodes
the incoming RF signal to a data signal and a clock signal. This part is built up by an
LNA (wake_lna), a detector (wake_det) and a decoder (wake_dec). The main block in
the wakeup_a is the digital control block, wake_ctrl, which interpret and handles the
incoming data, both from the detector/decoder and the MAC block. See Figure 18 for
better understanding concerning the architectural structure of the wakeup block.
- 30 -
System Analysis
The incoming RF signal needs to be amplified for detection and therefore the LNA
(wake_lna) must be used in the receiver. The low power requirements on the circuitry
do not allow the wake_lna to be active all the time. A solution to this is to use a strobe
signal that activates the LNA according to a specific duty cycle. The strobe signal is
extracted in the digital wake_ctrl block from the incoming clock signal from the
application. There is also an opportunity to use the direct strobe signal wu_en, which is
also coming from the application. The strobe signal is prolonged if a specific pattern is
detected in the incoming signal during the active strobe time. The strobe signal also
activates the other blocks in the incoming RF part, including the wake_det, wake_dec
and wake_bias. The wake_bias is a block that has a specified output of a bias current
for the wake_dec and the wake_lna. A register in wake_ctrl controls this block.
The ibs_in signal is coming from the application and determines if the wakeup_a
should be either an implant unit or a base station. If the ibs_in is set high, the
wakeup_a is an implant and should work as described. If the ibs_in is set low the
circuitry should work as a base station. In the base station mode the wakeup_a switch
on vdd, both to the MAC and the RF block at once (the same procedure as when a
correct message is received, when working as an implanted unit). When working as a
base station the wake_lna, the wake_det, the wake_dec and the wake_bias can be
completely switched off (strobe signal is set to low). The wake_ctrl is handling all the
communication with the MAC block and it is also controlling the enable signals to the
wake_vreg that feeds the MAC and RF block with regulated voltage.
The block wake_vreg has voltage regulators for achieving both digital voltage (1,8V)
and analogue voltage (2,1-2,2V) for the other circuitry. This block handles the power
- 31 -
Chapter 3
supply to all regulated digital parts and all regulated analogue parts in the complete
circuitry.
The signal mac_ready from the MAC is set high when the MAC is ready after it has
been powered up. When this signal is received the strobe signal is disabled and the
wake_lna, wake_det, wake_dec and wake_bias are switched off. When the MAC then
later sets the mac_ready signal low, the wake_ctrl block goes back to initial state and
listens to the strobe signal again.
The wake_por block is a power on reset function, which holds the device in reset until
the operating conditions are met. The interface_ctrl block only contains control gates
for having known values on the signals from the MAC to wake_ctrl, when the MAC is
without power. The testio bus is for test purpose and the output is controlled via the
testio_ctrl signal. A register in the wake_ctrl block sets this signal.
- 32 -
System Analysis
1 200µA 200 µA
200nA = 100nA + 200µA * ⇒ 200nA − 100nA = ⇒X = = 2000 (EQ 3)
X X 100nA
The incoming signal should at first be rectified in the detector. The detector may
consist of a rectifying diode and a capacitor. For really small signals as these (below -
20dBm), a peak diode detector (also called envelope detector) can give predictable and
useful amplitude measurements. The DC component of a diode output is proportional
to the square of the AC input voltage (the so-called square law). If RF input voltage is
reduced by half, the output will be one quarter as much DC. If 10 times as much RF
input is applied, the output will be 100 times as much DC as it was before. An increase
of 3dB results in twice as much output voltage. A diode with a lot of capacitance is out
of the question in this case because of the low power requirement and low voltage
input. A diode with a sharp I vs. V curve will give more output. Schottky diodes are
- 33 -
Chapter 3
great, but one drawback with them is that they require DC biasing to get into the really
curved part of the I vs. V curve.
When the signal is rectified it is redirected to a comparator that is fed with a reference
voltage Vref. The incoming signal should there be compared to this and clipped at the
definite threshold voltage and the output from this stage should be a reasonable square
wave, which represents the incoming RF signal. [6], [7], [8], [9], [21], [22]
The function of the block is that if the incoming signal consists of a short (S) ‘0’
followed by a short (S) ’1’ the output should be a ‘0’. The output will be synchronized
with the negative flank on the incoming data signal, used as the clock signal into the
digital part. On the other hand, if the input is a long (L) ‘0’ followed by a long (L) ‘1’
the output should be a ‘1’ (also synchronized with the negative flank on the incoming
data signal). Figure 20 describes the function of the signal path in the decoder.
- 34 -
System Analysis
The incoming signal to this block is accordingly used as the clock for the digital block.
Hence, the incoming signal to this block is the clock signal to this block’s output when
these two flows into the digital block. The RC net in the wake_dec block has a time
factor that distinguishes the input, depending on the burst length in time measured.
The RC net is only sensitive for the time between the negative flanks on the incoming
signal according to Figure 21. When the time between two negative flanks on the
signal is long enough (tlong, min) the RC net will be up-loaded and a 1 will be the output.
The figure below gives a hint about what is meant by the time constant for the RC net.
- 35 -
Chapter 3
Since the analogue front-end is strobed during a specific time the wake_ctrl block will
start looking for a specific pattern in the incoming data signal. The patterns the
wake_ctrl block will search for is 0101, 0110, 1001 or 1010. These combinations are
repeated in the sent data packet from the base station. This will happen because of the
Manchester encoding that is used. When the wake_ctrl block still receives this pattern
or the start sequence the strobe signal (ctrl_str) is held high, but if the pattern is lost the
ctrl_str signal will turn low. The start sequence is a signal pattern consisting of
11110000. If the wake_ctrl detects this, then it knows that a correct data packet is
coming in and of course the signal ctrl_str is kept high during the download of the
following specified number of data bits
When the start sequence is detected, it sets a flag high and the wake-up control block
starts to read in the rest of the data packet, which is Manchester encoded. If there is a
match on the company code (the first 8 bits or 16 bits Manchester encoded) and the
application ID (the following 26 bits or 52 bits Manchester encoded), the two enable
signals, vreg_en and osc_en, are set high. The application ID can also be matched with
a master ID, further discussed in the chapter about the data packet. When this is done
and the wake_vreg powers up the MAC block and the RF block, the MAC block
initiate contact with the wake-up block by setting the mac_ready signal high. When
this signal is received the wake_ctrl block sets the osc_en signal low.
The osc_en signal starts a RC oscillator in the wake_vreg, which put out the wdog_clk
signal (clock signal). This clock signal is used for a watchdog function, which resets
the wakeup_a if the mac_ready signal is not set high within a specified time. This
clock signal is generated for this purpose only and nothing else in the logic. Since the
- 36 -
System Analysis
RC oscillator producing this signal is only active for a very short time and not often at
all, the total power consumption of this is very low.
After receiving the high mac_ready signal, the wake_ctrl block waits for further
instructions by using the data bus system with strobe, addressing and read/write signal.
The incoming command can be reading or writing of trim-parameters, application ID,
company code or channel ID. Download of the trim-parameters to the wakeup block is
done in a special mode in the manufacturing line. There is also a reload mode where
the trim parameters can be downloaded again. Upload of the channel ID, application
ID and the trim parameters are done each time a correct incoming wakeup message is
detected on the 2.45 GHz signal and the MAC is fed with power. The MAC sends a
request for these bits by addressing the correct register holding the specific value. The
block is holding several trim parameters in different registers for the whole chip and
these are also available by addressing the correct register. Some registers are feeding
other blocks directly with trim parameters by having hard connections between them,
for example the bias_vect to the bias block.
The ibs_in pin sets the wakeup_a in either base station or implant mode. If the pin is
set low the circuitry is a base station and the wake_ctrl block powers up the MAC and
the RF block directly (same procedure as when being an implanted unit and a correct
wakeup message is received). The por_reset is the initial reset that sets the flip-flops
and registers to initial states in this block.
The block clk_div handles the strobing procedure. It puts out a strobe signal for the
wake_lna and the wake_det according to a specified duty cycle. This clock divider
uses the incoming clock from the application for knowing when to strobe and for how
long time. The strobe signal can also be directly inserted in this block by setting the
input signal wu_en high. The strobe signal is also prolonged if a correct pattern is
detected in the incoming signal. For more information and description of the wake_ctrl
block see chapter Digital Implementation on page 39.
The total time for detecting one of the specified pattern (described in the chapter The
digital block - wake_ctrl on page 35) is maximum 8Xs, since a pattern consists of 2 SL
or LS packets. To this, the time for a sent 1 (a long signal, L) is added. This is done
because the minimum amount of bits that can be received during this time is 5 bits (0
or 1’s). Out of these bits it can then be decided whether it contains one of the specified
patterns or not. The total time for strobing the wake_lna will then be 11Xs (8Xs+3Xs).
- 37 -
Chapter 3
The minimum time for short 1 and short 0 (0,5Xs, seen in Figure 17 on page 29) is
decided by the comparator in the detector stage. During the report was written there
were two different solutions of the detector stage uprising. They are called solution A
and solution B. The digital implementation done during the thesis work was designed
for solution A, because solution B was considered more risky at that time.
3.7.1 Solution A
The time 0,5X was in this solution set to 10µs, or X=20µs. This result in a total time of
11*20µs = 220µs for the analogue front-end to be strobed each time. 30µs was added
to the total minimum strobe time of 220µs, which result in 250µs as the needed time
for detecting one of the specified patterns. Finally to decide the time between two high
strobe signals, the value 250µs was multiplied by 2000, which gave 0,5s.
To sum up, the strobe has to be high every 0,5s for 250µs, which is pretty fair. The
maximum time for detection will at this moment be 0,5s + time for detecting the
message, which is the maximum time for sending 2 messages, 2*(50*4*20µs) = 8ms.
The maximum time will then totally be 0,5s + 0,008s = 0,508s for wakeup of the
circuitry.
3.7.2 Solution B
In this solution the time 0,5X was set to 4µs, giving X=8µs. This result in a total time
of 11*8µs = 88µs for the analogue front-end to be strobed each time. 30µs is added to
the total minimum strobe time 88µs, which result in 118µs as the needed time for
detecting the specified pattern. Finally the time between two high strobe signals were
calculated by multiplying the value 118µs with 2000, which gave 0,236s.
To sum up, the strobe has to be high every 0,236s for 118µs, which is very good. The
maximum time for detection will in this solution be 0,236s + time for detecting the
message, which is the maximum time for sending 2 messages, 2*(50*4*8µs) = 3,2ms.
The maximum time will then totally be 0,236s+0,0032s = 0,239s for wakeup of the
circuitry.
- 38 -
Digital Implementation
4 Digital Implementation
The thesis included a task that was to implement and design the digital wake_ctrl
block, which is described in the chapter about the system architecture. The
implementation was done in the Hardware Description Language, VHDL. VHDL is an
abbreviation for Very high-speed integrated circuits Hardware Description Language,
and is one of the two main HDL-languages in digital design. It is a big and general
hardware-description language, which gives several opportunities to describe the same
behavior with different language-designs.
The other main language is Verilog and it is a competing hardware design language to
VHDL. It is standardized and developed by an American company that was bought by
another company named Cadence. It was created before VHDL and thus is more
established, foremost in the USA. Verilog was used in the thesis work for writing the
testbenches, when testing the design.
The source code, written in VHDL was synthesized using Design Vision from
Synopsys. The code was synthesized against the component library for the process
0,18µm from TSMC, which is a mixed signal and RF process. The netlist from the
synthesizing was stored as a Verilog file and simulated together with the testbenches
using the simulator Verilog-XL. The results from the simulations were examined and
reviewed in the program Simvision from Cadence.
The following chapters describe the outcome of the digital implementation done
during the design phase of the thesis work. The top-level is first presented and after
that each sub block is described more in detail. The source code to each block is found
in Appendix B, and the testbench is found in Appendix C.
- 39 -
Chapter 4
Figure 23 presents the top level of the implemented digital design. The figure is an
extract from Design Vision, which were where the implementation was synthesized.
The design, called wake_ctrl_a, was divided into four main blocks. A special
wakeup_package was also created for having all constants in the design, predefined at
the same place. This solution has the benefit that it is easy to change a constant, used
often in the design (without any difficulties).
The block, start_check_a, search for the specific pattern 0101, 0110, 1001 or 1010 in
the incoming data signal, wake_data. If this pattern is detected, the strobe time is
prolonged until the pattern is lost or the whole packet is received. The start_check_a
block also looks for the pattern 1111 followed by 0000, which is the actual start
sequence of the data packet. When this pattern is detected, an enable signal is set to the
block wakein_decode_a, which at that moment starts to read in the following incoming
data bits.
The Manchester code is checked all the time during the download of the rest of the
data to a shift register in the wakein_decode_a block. When the correct amount of bits
is received and decoded (from the Manchester code), the shift register is checked
against the company code (or spec_compcode) and the application ID (or master ID).
If there is a match on these bits then it is assumed that a correct message was received
and the signals, wake_vreg and osc_en are set high. At the same time the channel ID is
- 40 -
Digital Implementation
put into a local register. This register has an output to the block para_data_inout_a,
which handles the communication with the MAC block.
When the MAC is powered up and running it sets the signal mac_ready high, which
the block para_data_inout_a receives. This signal disables the strobe signal ctrl_str and
the analogue front-end of the wakeup circuitry is powered down. After this the
para_data_inout_a handles the communication with the MAC by using the bus system
consisting of the str (strobe), rw (read=’1’, write=’0’), addr (address bus) and
data_inout (data bus). The functions are either read from or write to a register. When
the para_data_inout_a block receives the low mac_ready signal, it goes back to initial
state and the strobe signal, ctrl_str, is again enabled.
- 41 -
Chapter 4
When the data starts to be read in to the shift register a counter is started as well. If this
counter reaches the number 5, it is assumed that there is no wakeup message and the
strobe is not prolonged. If the block finds the pattern the counter is reset. If the
beginning of the start sequence (1111) is found the counter is also reset, but it allows
only four more bits to be read in and these are then compared to 0000. If there is a
match on these bits, the start sequence is found and the enable signal to the
wakein_decode_a is set high.
The incoming data is decoded from the Manchester encoding before it is put into the
shift register. At the same time it checks automatically that the Manchester encoding is
OK. If the Manchester encoding is not correct, the circuitry is reset and goes back to
the initial state.
After detecting the correct wakeup signal, the wakein_decode_a block waits for the
mac_ready signal to turn high from the MAC block. If this signal is received, the
osc_en signal is turned low and the digital block is ready for communication via the
bus system. The para_data_inout_a block handles this communication. When the
osc_en signal turned high, it activated an RC oscillator in the wake_vreg block. This
RC oscillator extracts a clock signal, which enables a counter that starts to count to a
specific number. This is a so-called watch dog function and is implemented as a
backup, if the high mac_ready signal never arrives to the block from the MAC. If the
watch dog signal from the wake_vreg turns high the digital block is reset and goes
back to the initial state.
- 42 -
Digital Implementation
For example, if the MAC wants to write in a new value to a register it puts out the
correct address on the address bus and the data is put out to the data bus and the
read/write signal is set to 0. Shortly after this, the MAC sets the strobe signal high and
this block does the correct action at this moment. When the MAC assumes that the
action is done, it sets the strobe signal low and a new reading or writing of registers
can be initiated.
- 43 -
Chapter 4
Two clock signals are extracted from strobe_clk2_a and put into another design made
in VHDL called strobe_clk_a. The extracted clock signals are a 4 kHz signal and a 2
Hz signal. These two are then used for making the strobe signal turn high every 0,5s
for 250µs. This strobe window is calculated from the given value of the sent message
and is depending on the detector in the front-end and the RC net in the decoder block.
For more information about this see chapter The strobing time on page 37.
- 44 -
Digital Implementation
There is also an opportunity to use the signal wu_en for setting the strobe signal. This
signal is used if an application wants to calculate the strobe window itself instead of
sending a clock signal to the wakeup.
4.2 Simulations
When the RTL code was synthesized a netlist was created. The netlist was stored as a
Verilog file and simulated for verification together with a testbench by using the
simulator Verilog-XL. The results from the simulations were examined and reviewed
in the program Simvision from Cadence. The simulation results are shown in this
chapter in the extracts from the waveform windows from Simvision.
When the start sequence is detected (approximately at 2,2µs) the enable signal for the
wakein_decode block is set high. After this the following 92 bits are read in and
decoded to company code, application ID and channel ID. If there is a match on the
company code and the application ID, the channel ID is set as an output to the
para_data_inout block (approximately at 6,6µs). At the same time the vreg_en and
osc_en signals are set high as seen. The osc_en signal is then set low when the
incoming signal mac_ready is set high.
- 45 -
Chapter 4
Shortly after this (approximately at 8,3µs) the communication with the MAC on the
bus system is started. First the write-to-registers are shown and shortly after that
(approximately at 12,6µs) the read-from-registers are shown. Shortly after 16,4µs the
signal mac_ready from the MAC is set low and the behavior of this is that the whole
chip shall return to the initial state, without resetting the registers. The vreg_en signal
is set low and so on. The block now again listens to the input signal wake_data and
starts to decode this again.
In the second wakeup message (starting at approximately 18,6µs), the company code
is the spec_compcode and the application ID is the appid. These were downloaded to
the specific registers during the communication over the bus system earlier (started
approximately at 8,4µs and 12,2µs). Short after 24µs, the detecting of this message is
shown working OK.
As seen in Figure 25 each register gets its value when the strobe turns high and the
correct address is on the address bus.
- 46 -
Digital Implementation
As seen in Figure 26, data from correct register is put out to the data_inout bus when
the strobe is high and correct address is on the address bus. To see that correct address
is addressing correct register see Figure 25 above, where each register gets its value.
As seen in Figure 27 the wake_data is read in to the pattern_vect on the negative clock
edge of the wake_sig (used as clock). A counter starts to count and if its counts up to
more than 5, the strobe signal is set low (for example at 0,85µs and 1,25µs) and no
valid pattern is detected. If an OK pattern is detected the strobe signal ctrl_str is pro-
longed. If the first four bits (7 down to 4) of the pattern_vect is 1111 (approximately at
2,29µs); the only valid pattern for the next four bits is 0000. If this sequence of pattern
is detected, the start sequence is found and the enable signal enb is set high
(approximately at 2,48µs). This signal is the enable signal for the wakein_decode
block, which reads in the rest of the message.
In Figure 28 (it shows) that two bits are read in after each other to the vector two_vect.
This vector is then compared to 01 or 10 for checking and decoding the Manchester
code. At the same time the total amount of bits are counted and when the correct
- 47 -
Chapter 4
number, in this case 92 or hex 5C, is reached, the register is checked against the
application ID and the company code. The waveform also illustrates (approximately at
7,2µs) that a correct channel ID is sent forward and the signals, osc_en and vreg_en
are presented.
In the waveform in Figure 29, the Manchester coding was interrupted (approximately
at 20,9µs). The testbench were prepared for this as seen in Appendix B.
In this waveform (Figure 30) the application ID did not match, but the Manchester
code was OK. The vreg_en and osc_en signal are never set high (approximately at
24µs) after the receiving of the message. The testbench were prepared for this as seen
on page 25 in this document.
- 48 -
Digital Implementation
To get the extraction from the incoming clock signal the simulation time needed to be
longer. In the waveform in Figure 31 the testbench were prepared for this as seen in
Appendix C in this report.
When the ibs_in signal is set low (approximately at 2µs and 20,8µs in Figure 32) the
function shall be the same as when a correct message is detected. Shortly after 2µs the
watchdog function is tested (used if the mac_ready signal never turns high) and as seen
the logic is reset and goes back to initial state, when the ibs_in is set high and the
watch_dog is set low again. At 20,8µs the mac_ready signal turns high as expected
and then soon after that it turns low again and everything is reset and goes back to
initial state. The testbench were prepared for this as seen on page 17 and 26 in this
document.
- 49 -
Chapter 4
4.3.1 RTL-coding
The actual design process starts with the RTL-coding (Register Transfer Level), which
in this project was done in VHDL (in Verilog for the testbench). RTL-coding means
capture of the design information in a format ready for direct input to a logic synthesis
- 50 -
Digital Implementation
tool. This capture may go through one or more stages, for example schematic capture
of connectivity between sub-blocks followed by automatic generation of structural
code followed by addition of behavioral code. As well as design information, a
testbench for verification of the RTL code and synthesis scripts are also produced
during this stage.
Synthesis scripts should contain realistic constraints and commands for the synthesis
tool and the RTL code should be mapped-to-gates to prove that the scripts work
efficiently, and to provide an area estimate. The design report document should also be
started during this process and should contain enough information to enable a
colleague to understand both the RTL code and the synthesis scripts.
The input to this stage is the requirement specification and logic library in formats
suitable for synthesis and simulation. The output from this stage should be the source
RTL code, testbench and synthesis scripts and constraints.
The input to this stage is the actual RTL Code, the testbench and behavioral models of
any analogue blocks required for co-simulation with the digital block. Sufficient proof
needs to be provided to convince an RTL review, so that the block conforms to the
specification. This could take the form of printouts, log files and/or a demonstration
using a workstation.
4.3.3 Synthesis
Synthesis is the process of compiling the RTL Code to logic expressions, optimizing
the logic and mapping the result onto logic gates in a specified technology library. The
input to this stage is the RTL code, synthesis set-up file, synthesis scripts, synthesis
constraints and layout data.
The synthesis set-up file contains information, which is general to the project, such as
the technology library to be used. The command scripts directs the synthesis tool, such
as telling it what files to analyze, what compile options to use, to what log file to direct
the output etc. The constraints file specifies clock waveforms and environmental
constraint, such as input delay and drive capability of each input and output delay and
load of each output. Layout data is needed for physical synthesis where the block
aspect ratio and pin positions need to be known for placement of gates.
- 51 -
Chapter 4
The outputs from this stage are gate-level netlist (in Verilog), test protocol file, data
base file, log file, placement information and parasitic data, an updated design report.
The netlist in Verilog, placement information (.pdef file) and parasitic data (.sdf file)
are used by the layout tool; the parasitic data can be used for constraint-driven routing.
The test protocol file is used for generating scan test patterns.
The inputs to this stage are the gate-level netlist in Verilog, STA script, synthesis
constraints and scripts for other tools that carry out formal verification or power
analysis, a testbench in Verilog. The output of this process is a proof of conformance,
as in the RTL-simulation stage. In practice this means sufficient proof to convince an
audience of people that the block conforms to specification
4.3.5 Layout
Block layout takes a flat gate-level netlist containing connectivity information, target
area and shape of required layout, pin positions, placement data and timing constraints
and performs automated cell placement and routing to produce a fully placed and
routed DEF netlist. Also produced are an RC parasitics report for timing verification,
an abstract in LEF format for top-level routing and a stream file for physical
verification. If physical synthesis is used then the placement of cells will already have
been done during the synthesis process. The layout process will also insert a power
frame around the block and a power mesh over it to which individual cells are
connected.
The inputs to this stage are the Verilog netlist, required area of layout, required shape
of layout, required pin positions, placement data (if physical synthesis is used), timing
constraints (if physical synthesis is not used). The output is a fully placed and routed
DEF netlist, file of RC parasitics, abstract in LEF format for top-level routing, stream
file of layout data for physical verification.
- 52 -
Digital Implementation
original netlist. A formal verification tool can be used to confirm that the netlist
extracted from the layout is the same as that produced by the synthesis process.
The input to this stage is the gate-level netlist in Verilog, STA script, synthesis
constraints, scripts for other tools that carry out formal verification or power analysis,
a testbench in Verilog. The output of this process is a proof of conformance to the
specification as in the other verification stages.
- 53 -
Results
5 Results
The final data packet, shown on page 27 in the report, is one of the outcomes of the
thesis work. The packet was developed continuously during the progress of the project.
Once the data packet was defined the incoming RF stage could be investigated. A
requirement specification for the wakeup block was written during the system analysis
part. This document is confidential but most of the information from this is found in
this report.
The final proposal to a complete system design for the wakeup block in the RF
transceiver is shown on page 31. The front-end consists of an LNA, a simple detector
and a special decoder. Since there was an intention not to have a clock signal available
in the digital part, (because of this) self-clocking methods on the incoming RF signal
had to be investigated. The solution to this was the special decoder shown on page 34.
The decoder distinguishes the incoming RF signal concerning the burst lengths in
time. The decoder consists of an RC net that is uploaded and then has an output of 1, if
the burst length is long enough and vice versa.
After field measurements according to attenuation in human tissues (see page 29 for
more information), it was decided to use an LNA in the front-end. This LNA could not
be active all the time, because of the requirements on low power consumption
(<200nA) in the wakeup block. The solution to this was to use a strobe signal for the
complete front-end, which activates it. This strobe signal was extracted in the digital
logic. The strobe signal has a specific duty cycle, depending on the time factors in the
detector and in the decoder in the front-end. The strobing time is at this moment high
for approximately 250µs every 0,5s (for more information see chapter The strobing
time on page 37). This is the strobe signal implemented in the digital solution also
done in this thesis work.
- 55 -
Chapter 5
The implementation of the digital block is made in VHDL (source code) and Verilog
(testbenches). The source code was synthesized against the component library for the
process 0,18µm from TSMC, which is a mixed signal and RF process. The netlist from
the synthesizing was stored as a Verilog file and simulated together with the
testbenches using the simulator Verilog-XL. The results from the simulations were
examined and reviewed in the program Simvision from Cadence. The result was then
verified during a pre-layout review together with colleagues at Zarlink Semiconductor
AB. During the implementation phase a Design report was written continuously and
then used for the pre-layout review. Extracts (source code and testbench) from this
document can be found as appendixes to this report.
New functions to add to the digital design are very likely to arise. These should be
easy to implement in the design. If there for example will be any changes to the data
packet, all constants in the source code are easy to change because of the
wakeup_package used in the design. The structure of the RTL-code is hierarchical and
it is therefore easy to implement more blocks if necessary.
At this moment the digital design process has reached the layout stage and the next
task is to do post-layout simulations with updated timing files and parasitic extractions
from the layout stage.
- 56 -
References
6 References
[1] A. Burr, Modulation and coding for wireless communications, Prentice Hall, 2001
[2] K. Chang, RF and Microwave Wireless Systems, John Wiley & Sons, 2000
[4] Dr. K. Feher, Wireless Digital Communications; Modulation and spread spectrum
Applications, Prentice-Hall, 1995
[12] Manchester encoding using RS232 for Microchip PIC RF applications (2003-02-07)
http://www.quickbuilder.co.uk/qb/articles/
- 57 -
Chapter 6
[15] Packet Error Rate Measurements Using the PRISM® Chip Set (2003-02-12)
http://www.intersil.com/data/AN/AN9623.pdf
[17] CRC-16 Algorithm for Packetized WLAN Protocols on the HFA3824 (2003-01-27)
http://www.intersil.com/data/an/an9701.pdf
- 58 -
References
- 59 -
Appendix A
Appendix A Abbreviations
AC Alternating Current
ASK Amplitude Shift Keying
BS Base station
CDMA Code Division Multiple Access
CMOS Complementary Metal Oxide Semiconductor
CRC Cyclic Redundancy Check
CT2 Cordless Telephone 2
DC Direct Current
DECT Digital Enhanced Cordless Telephone
DVB-S Digital Video Broadcasting – Satellite
EFTA European Free Trade Association
ETSI European Telecommunications Standards Institute
FM Frequency Modulation
FSK Frequency Shift Keying
IF Intermediate Frequency
IU Implanted Unit
ISM Industrial, Scientific and Medical
I/Q Inphase/Quadrature
LNA Low Noise Amplifier
LO Local Oscillator
MAC Media Access Controller
MICS Medical Implant Communication System
OOK On/Off Keying
PA Power Amplifier
PCB Printed Circuit Board
PDA Personal Digital Assistant
PSK Phase Shift Keying
RF Radio Frequency
- 61 -
Appendix A
Definitions
dB Deci-Bell
dBm dB relative to 1mW
- 62 -
Appendix B
The design was implemented using VHDL as HDL-language and then synthesized
using Design Vision from Synopsys. The netlist was stored as Verilog file and
simulated in Verilog XL with testbenches written in Verilog.
A package called wakeup_package was created, which includes all constants used in
the other entities. The code for this is presented first and after that the main block
called wake_ctrl, which includes the start_check, wakein_decode, para_data_inout and
clk_div are presented.
wakeup_package
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
PACKAGE wakeup_package IS
CONSTANT companycode: INTEGER := 16; --man. coded, actual vector length divided by 2
CONSTANT applicationid: INTEGER:=52; --man. coded, actual vector length divided by 2
CONSTANT channelsel: INTEGER:=24; --man. coded, actual vector length divided by 2
CONSTANT startsequence: INTEGER:=8; --actual vector length of startsequnece (not man. coded)
CONSTANT fullcount: INTEGER:=7; --vector length of counter (min total bits)
CONSTANT addr_bus_width: INTEGER:=7; --address bus width
CONSTANT data_bus_width: INTEGER:=8; --data bus width
--Hardcoded companycode
SUBTYPE comp_vect IS STD_LOGIC_VECTOR((companycode/2)-1 DOWNTO 0);
CONSTANT companycode_vect: comp_vect:="11111111";
--Hardcoded Master ID
SUBTYPE master_vect IS STD_LOGIC_VECTOR((applicationid/2)-1 DOWNTO 0);
CONSTANT Masterid_vect: master_vect:="01010101010101010101010101";
END wakeup_package;
wake_ctrl_a
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE work.wakeup_package.ALL;
- 63 -
Appendix B
ENTITY wake_ctrl_a IS
PORT( wake_sig: IN STD_LOGIC;
wake_data: IN STD_LOGIC;
mac_ready: IN STD_LOGIC;
wu_clk: IN STD_LOGIC;
wu_en: IN STD_LOGIC;
ibs_in: IN STD_LOGIC;
str: IN STD_LOGIC;
rw: IN STD_LOGIC;
por_reset: IN STD_LOGIC;
watch_dog: IN STD_LOGIC;
addr: IN STD_LOGIC_VECTOR(addr_bus_width-1 DOWNTO 0);
data_inout: INOUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0);
vreg_en: OUT STD_LOGIC;
osc_en: OUT STD_LOGIC;
ctrl_str: OUT STD_LOGIC;
tr1: OUT STD_LOGIC;
tr2: OUT STD_LOGIC;
bias_vect: OUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0);
sens_vect: OUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0);
testio_ctrl: OUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0)
wu_tune: OUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0)
);
END wake_ctrl_a;
COMPONENT start_check_a
PORT( clk_in_pre: IN STD_LOGIC;
data_in_pre: IN STD_LOGIC;
reset_pre: IN STD_LOGIC;
Out_Enb_pre: OUT STD_LOGIC;
start_lna_strobe: OUT STD_LOGIC
);
END COMPONENT;
COMPONENT wakein_decode_a
PORT( clk_in_code: IN STD_LOGIC;
data_in_code: IN STD_LOGIC;
in_enb_code: IN STD_LOGIC;
wake_ibs_in: IN STD_LOGIC;
in_mac_ready: IN STD_LOGIC;
in_por_reset: IN STD_LOGIC;
in_watch_dog: IN STD_LOGIC;
appid_vect_in: IN STD_LOGIC_VECTOR((applicationid/2)-1 DOWNTO 0);
spec_compcode_in: IN STD_LOGIC_VECTOR((companycode/2)-1 DOWNTO 0);
wrong_detect: OUT STD_LOGIC;
wake_sig: OUT STD_LOGIC;
listen_strobe: OUT STD_LOGIC;
osc_en_out: OUT STD_LOGIC;
data_out: OUT STD_LOGIC_VECTOR((channelsel/2)-1 DOWNTO 0)
);
END COMPONENT;
COMPONENT para_data_inout_a
PORT( strobe: IN STD_LOGIC;
para_rw: IN STD_LOGIC;
addr_vect: IN STD_LOGIC_VECTOR(addr_bus_width-1 DOWNTO 0);
para_por_reset: IN STD_LOGIC;
para_ibs_in: IN STD_LOGIC;
channel_in: IN STD_LOGIC_VECTOR((channelsel/2)-1 DOWNTO 0);
data_in_out: INOUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0);
appid_vect_out: OUT STD_LOGIC_VECTOR((applicationid/2)-1 DOWNTO 0);
spec_compcode_out: OUT STD_LOGIC_VECTOR((companycode/2)-1 DOWNTO 0);
para_bias_vect: OUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0);
para_atest_vect: OUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0);
para_sens_vect: OUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0);
para_wu_tune: OUT STD_LOGIC_VECTOR(data_bus_width-1 DOWNTO 0);
para_reset_out: OUT STD_LOGIC;
para_tr1: OUT STD_LOGIC;
para_tr2: OUT STD_LOGIC
);
END COMPONENT;
COMPONENT clk_div_a
PORT( mwu_clk_in: IN STD_LOGIC;
- 64 -
Appendix B
start_strobe: IN STD_LOGIC;
in_por_reset: IN STD_LOGIC;
decode_reset: IN STD_LOGIC;
in_listen_strobe: IN STD_LOGIC;
in_para_ibs_reset: IN STD_LOGIC;
in_wu_en: IN STD_LOGIC;
in_watch_dog: IN STD_LOGIC;
out_ctrl_str: OUT STD_LOGIC;
reset_out: OUT STD_LOGIC
);
END COMPONENT;
BEGIN
END rtl;
start_check_a
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
USE work.wakeup_package.ALL;
ENTITY start_check_a IS
- 65 -
Appendix B
reset_pre: IN STD_LOGIC;
start_lna_strobe: OUT STD_LOGIC
);
END start_check_a;
SUBTYPE count IS INTEGER RANGE 0 TO (startsequence); -- counter for the correct amount of bits
SIGNAL counter: count;
BEGIN
- 66 -
Appendix B
wakein_decode_a
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
USE work.wakeup_package.ALL;
ENTITY wakein_decode_a IS
END wakein_decode_a;
BEGIN
wrong_detect <= reset_int OR nada;
wake_sig <= wake_sig_int AND (NOT in_watch_dog);
data_out <= correct_channel_vect;
compandappid_vect <= appid_vect_in & companycode_vect;
speccompandappid_vect <= appid_vect_in & spec_compcode_in;
speccompandmasterid_vect <= Masterid_vect & spec_compcode_in;
SUBTYPE minicount IS INTEGER RANGE 0 TO 1; -- counter for the correct amount of bits
VARIABLE count_one: minicount;
BEGIN
IF (in_enb_code=’0’) THEN
count_code <= (OTHERS =>’0’);
count_one :=0;
man_code <= ’0’;
ELSE
IF (FALLING_EDGE(clk_in_code)) THEN
IF (count_code <= (companycode+applicationid+channelsel-1)) THEN
CASE count_one IS
WHEN 0 => store_data <= data_in_code;
count_code<=count_code+1;
count_one:=count_one+1;
man_code <= ’0’;
WHEN OTHERS => two_vect <= data_in_code & store_data;
count_code<=count_code+1;
count_one:=0;
man_code <= ’1’;
END CASE;
ELSE
count_one:=0;
man_code <= ’0’;
END IF;
END IF;
END IF;
END PROCESS P1;
- 67 -
Appendix B
CASE man_code IS
WHEN ’1’ => IF (RISING_EDGE(clk_in_code)) THEN
CASE two_vect IS
WHEN "10" => correct_code_vect <= ’0’ & correct_code_vect(((companycode+applicationid+chan-
nelsel)/2)-1 DOWNTO 1);
IF (count_code = (companycode+applicationid+channelsel)) THEN
check_code <=’1’;
ELSE
check_code <=’0’;
END IF;
WHEN "01" => correct_code_vect <= ’1’ & correct_code_vect(((companycode+applicationid+chan-
nelsel)/2)-1 DOWNTO 1);
IF (count_code = (companycode+applicationid+channelsel)) THEN
check_code <=’1’;
ELSE
check_code <=’0’;
END IF;
WHEN OTHERS => check_code <=’1’;
correct_code_vect <= (OTHERS => ’0’);
END CASE;
END IF;
WHEN OTHERS => IF (in_enb_code=’0’) THEN
correct_code_vect <= (OTHERS => ’0’);
check_code <= ’0’;
END IF;
END CASE;
END PROCESS P2;
- 68 -
Appendix B
para_data_inout_a
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE work.wakeup_package.ALL;
ENTITY para_data_inout_a IS
END para_data_inout_a;
BEGIN
appid_vect_out <= r00001_appid1 & r00010_appid2 & r00011_appid3 & r00100_appid4(data_bus_width-1 DOWNTO
data_bus_width-2);
spec_compcode_out <= r10001_compcode;
- 69 -
Appendix B
- 70 -
Appendix B
END CASE;
END PROCESS P2;
P4: PROCESS(para_ibs_in)
BEGIN
CASE para_ibs_in IS
WHEN ’1’ => nreset <= ’0’;
WHEN OTHERS => nreset <= ’1’;
END CASE;
END PROCESS P4;
END rtl;
clk_div_a
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY clk_div_a IS
PORT( mwu_clk_in: IN STD_LOGIC;
start_strobe: IN STD_LOGIC;
in_por_reset: IN STD_LOGIC;
decode_reset: IN STD_LOGIC;
in_listen_strobe: IN STD_LOGIC;
in_para_ibs_reset: IN STD_LOGIC;
in_wu_en: IN STD_LOGIC;
in_watch_dog: IN STD_LOGIC;
out_ctrl_str: OUT STD_LOGIC;
reset_out: OUT STD_LOGIC
);
END clk_div_a;
COMPONENT strobe_clk2_a
PORT( reset: IN STD_LOGIC;
clk32kHz: IN STD_LOGIC;
clk2Hz_out: OUT STD_LOGIC;
clk4KHz_out:OUT STD_LOGIC
);
END COMPONENT;
COMPONENT strobe_clk_a
PORT(clk4KHz_in: IN STD_LOGIC;
clk2Hz_in: IN STD_LOGIC;
strobe_out: OUT STD_LOGIC
);
END COMPONENT;
BEGIN
- 71 -
Appendix B
strobe_clk_a
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
ENTITY strobe_clk_a IS
END strobe_clk_a;
BEGIN
BEGIN
IF (clk2Hz_in=’0’) THEN
counter<=0;
strobe_out<=’0’;
ELSIF (RISING_EDGE(clk4KHz_in)) THEN
CASE counter IS
WHEN 0 => strobe_out<=’1’;
counter<=counter+1;
WHEN OTHERS => counter<=counter;
strobe_out<=’0’;
END CASE;
END IF;
END PROCESS P1;
END rtl;
strobe_clk2_a
This block was designed manually in Cadence and therefore there is no source code
written in VHDL or Verilog. This clock divider was designed because it has lower
power consumption compared to a standard divider made in VHDL. The output of this
block is the input to the strobe_clk_a which create the strobe signal ctrl_str.
- 72 -
Appendix C
Appendix C Testbench
The testbenches that were designed and used during the verification phase in
simulations were written in Verilog. The same testbench was used, with minor
changes, for showing that the logic worked as wanted when different scenarios
appeared. In the testbench wake_ctrl_testb, there are comments showing where these
changes were made.
wake_ctrl_testb:
‘timescale 1ns/1ns
module wake_ctrl_testb_a;
reg wake_sig, wake_data, mac_ready, wu_clk, wu_en, ibs_in, str, rw, por_reset, watch_dog;
reg [6:0] addr;
reg [7:0] data_in;
wake_ctrl_a DUT ( wake_sig, wake_data, mac_ready, wu_clk, wu_en, ibs_in, str, rw, por_reset, watch_dog,
addr, data_inout, vreg_en, osc_en, ctrl_str, bias_vect, sens_vect, testio_ctrl );
initial
begin
por_reset=1’b0; //por_reset=’0’
watch_dog=1’b0; //watch_dog_XO =’0’
ibs_in=1’b1; //ibs=1
wu_en=1’b0; //wakeup_enable, direct control over lna_str and det_str
str=1’b0; //str from MAC used the bus system
rw=1’b0; //read/write signal from MAC used the bus system
addr=7’b0000000; //address from MAC used the bus system
mac_ready=1’b0; //mac_ready signal from MAC
#525
por_reset=1’b1; //por_reset=’1’;
wake_data=1’b1; //simulated RF data clocked in with wake_sig simulated further down
//start_check start to look for specified pattern
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
- 73 -
Appendix C
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
//ibs_in=1’b0; //used in testbench when testing the ibs pin function. See figure 11
wake_data=1’b0;
#50
// watch_dog=1’b1; //watchdog =’1’, go back to sleep mode, used when tesing ibs pin
wake_data=1’b1;
#50
// watch_dog=1’b0; //watchdog =’1’, go back to sleep mode, used when testing ibs pin
// ibs_in=1’b1; //used in testbench when testing the ibs pin function
wake_data=1’b0;
#50
wake_data=1’b1; //start sequence begin
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b0; //start sequence at end
#50
wake_data=1’b1; //0 First bit in companycode & codecheck
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
- 74 -
Appendix C
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0; //7
#50
wake_data=1’b1; //8
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0; //15 Last bit in companycode
#50
wake_data=1’b1; //16 first bit in Device ID or Master ID
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0; //16
#50
wake_data=1’b0; //17
- 75 -
Appendix C
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1; //68 Last bit in Device ID/Master ID
#50
wake_data=1’b0; //69 first bit in channel ID
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
- 76 -
Appendix C
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1; //92 last bit in channelsel
#50
wake_data=1’b1; //wakein_decode shall not shift in any more data
#50
mac_ready=1’b1; //mac_ready sets high (assumed that correct packet was detected)
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
data_in=8’b10000001; //data is set to the data_inout bus
rw=1’b0; //read/write is set to 0 = write
addr=7’b1100000; // adress "00000" => reg_00000;
#50
str=1’b1; //strobe sets high and para_data_inout handles the communication on the bus
#50
str=1’b0; //strobe sets low and para_data_inout stops the communication on the bus
data_in=8’bz;
#100
data_in=8’b10100001;
rw=1’b0;
addr=7’b1100001; // "00001" => r00001_appid1;
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b10101001;
rw=1’b0;
- 77 -
Appendix C
- 78 -
Appendix C
str=1’b0;
data_in=8’bz;
#100
data_in=8’b11111000;
rw=1’b0;
addr=7’b1101001; // "01001" => tx_freq_sep
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b11111100;
rw=1’b0;
addr=7’b1101010; // "01010" => rx_det_filter_tune
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b11111110;
rw=1’b0;
addr=7’b1101011; // "01011" => rx_if_filter_tune
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b00000011;
rw=1’b0;
addr=7’b1101100; // "01100" => tx_if_filter_tune
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b00001111;
rw=1’b0;
addr=7’b1101101; // "01101" => decision_level
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b00000001;
rw=1’b0;
addr=7’b1101110; // "01110" => rssi_ref
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b10001111;
rw=1’b0;
addr=7’b1101111; // "01111" => xo_cap
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b10011001;
rw=1’b0;
addr=7’b1110001; // "10001" => r10001_compcode
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#100
data_in=8’b11111001;
rw=1’b0;
addr=7’b1110000; // "10000" => ref_r
#50
str=1’b1;
#50
str=1’b0;
data_in=8’bz;
#500
rw=1’b1; //rw set to 1 = read, when strobe goes high the value from
- 79 -
Appendix C
- 80 -
Appendix C
addr=7’b1110001;
#50
str=1’b1;
#50
str=1’b0;
#50
addr=7’b1110010;
#50
str=1’b1;
#50
str=1’b0;
#50
addr=7’b1110011;
#50
str=1’b1;
#50
str=1’b0;
#50
addr=7’b1110100;
#50
str=1’b1;
#50
str=1’b0;
#50
addr=7’b1110110;
#50
str=1’b1;
#50
str=1’b0;
#500
addr=7’b0000000;
#500
mac_ready=1’b0; //mac_ready set low, go back to sleep mode
#500
wake_data=1’b1; //new rf signal
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
- 81 -
Appendix C
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1; //start sequence begin
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b0; //start sequence at end
#50
wake_data=1’b1; //0 First bit in companycode, this time the spec_companycode
// that was read in during the first RF signal
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0; //7
#50
wake_data=1’b1; //8
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0; //15 Last bit in spec_companycode
#50
wake_data=1’b0; //16 first bit in Device ID that was read in during the
// first RF signal
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1; //this bit is changed when testing the Manchester code! See figure 8
#50
wake_data=1’b0; //together with the changed bit above this bit is changed
#50 //and it is then wrong application ID, but ok Manchester code! See figure 9
- 82 -
Appendix C
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
//ibs_in=1’b0; //used in testbench when testing the ibs pin function. See figure 11.
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
// mac_ready=1’b1; //mac_ready sets high (assumed that MAC nad RF part started correct)
//used when testing ibs pin
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
// mac_ready=1’b0; //mac_ready sets low (assumed that MAC wants to power down)
//used when testing ibs pin
wake_data=1’b1;
#50
//ibs_in=1’b1; //used in testbench when testing the ibs pin function
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
- 83 -
Appendix C
#50
wake_data=1’b1;
#50
wake_data=1’b0; //68 Last bit in Device ID
#50
wake_data=1’b1; //69 first bit in channel ID
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
mac_ready=1’b1; //mac_ready sets high (assumed that correct packet was detected)
//not used when testing ibs
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1; //92 last bit in channel ID
#50
wake_data=1’b1; //following data shall not be shifted in
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
#50
wake_data=1’b1;
#50
wake_data=1’b0;
// #500020 //this prolongs the simulation... needed for test of strobe-extraction
// wu_en=1’b1; //these bits are needed for testing the wu_en signal. See figure 10 further down.
// #3980
// wu_en=1’b0;
// #5980
// wu_en=1’b1;
// #5020
// wu_en=1’b0;
// #485000
#50
wake_data=1’b1;
#50
$finish;
end
always
begin
#5
wu_clk=1’b1; //incoming clock signal from application (32kHz in this implemetation)
- 84 -
Appendix C
#5
wu_clk=1’b0;
end
always
begin
#25
wake_sig=1’b1; //incoming RF signal used as clocksignal
#25
wake_sig=1’b0;
end
initial
begin
$dumpfile("wake_ctrl_a_dump.vcd");
$dumpvars;
end
endmodule
- 85 -