Synthesis and implementation of a seven-segment display

Synthesis and implementation of a seven-segment display

By ben06x | Electronics | 5 Apr 2021


Through this practical work we will describe sequential and combinatorial blocks in the form behavioral. We will thus see the impact of this writing on the inference of the blocks from the RTL scheme. We will then obtain the technological diagram from the previous diagram. The performance of the implementation will then be analyzed. Finally, by the physical implementation of the circuit we will test our code. This will require the definition of constraints for the assignment of legs of the circuit.

 

Goal : displaying value on a seven-segments display

0690fed98896722fe4ec10f1ead42f53dbfcd1c7bad441cea86c4ece90cfa2a5.jpg

 

1. VHDL Implementation

 

We want to create the display block to view the modem configuration mode (mode input), using six seven-segment displays.

 

1.1 Circuit interface

In a display.vhd file, we define the circuit interface using the following display entity:

 

80b963cd98e6eef3fca39268b2b53c17a9cc1806bbc1bd17ba3e96aaa1070f76.jpg

 

We have the input and output signals of type std_logic and std_logic_vector.

 

1ef48eaff309c8aec337ab3205d3eb1c6467ae2fda8093e47e220c48979eee1b.jpg

 

 

1.2. BEH behavioral architecture

We define a BEH behavioral architecture based on the following ASM:

 

a3b6ff78b816f6d4811522da5e1e39fcb140fe8672a92156d34599a83ca7a262.jpg

 

This definition is carried out with two processes. A synchronous process on clk and rst to describe the register transfer to be performed on mm or force to 00 on asynchronous rst true low. Another combinatorial process to describe the output combinations of the six displays as a function of mm by using a case statement.
We therefore used the internal signal mm because M is configured as an output only.

 

a082ae3a9352c95ef28efe3e6c54038c09c9b6e38e11383e205a57db52ea1d71.jpg

 

 

1.3 Testbench

We have the following testbench:

64fbed9398185944f4b9d831a18be65e614f186eb4249693da6ebd4a23153ac8.jpg

 

 

1.4. BEH Simulation

We write a display.tcl script for our BEH simulation of the block under Modelsim.

We obtain the following:

 

e0347f39f8932311490d3210f02f6c617e14a7330294130c1e657d5c6e60e370.jpg

 

 

We obtain the following chronogram:

 

29c839c5c3b50acf65e7c929fea3f18ab2903f39b6eb3bc28b8c8167e195c4a8.jpg

 

We have the expected behavior of ASM. When dtr is at ‘1’, synchronously M ← Mode and depending on its value, the displays show us the configuration mode of the modem, on aff0 and aff1 the transmission mode is indicated to us, bidirectional (FD) or alternate (HD), on the other four aff* the transmission rate in bps is indicated (400,800 or 1200). When dtr is ‘0’ the transfer does not apply.

43e1b9ece62dd59f4aa12e812092d245fd3a8f9f631c4c32c6a4eb22dc51c608.png

 

We thus wish to physically test our behavioral architecture on the FPGA of the ALTERA card.

 

2. Synthesis of the VHDL description using interactive menus

 

2.1. Compilation 

We launch precision synthesis RTL 17.1. The goal is to generate our architecture corresponding to the behavioral input description. The synthesis is carried out on the basis of generic gates.
We thus choose the CYCLONE II EP2C35F672C circuit at speed 6. After inserting our description and compilation we get the following implementation:

c88eba4f3822b677f29944e33cc45c06b25abd7b38c7eda3badc1128b7087e06.png

 

The sequential part in red is limited to the use of a synchronous register on each bit of M with a load control input connected to the dtr input.
The combinatorial part in blue is formed by logical operators to determine the values assigned to the segments as a function of M. We notice that some segments have a constant value, independent of M.

1c6d2884864e5cb9f74539b9f950af889c13ae350724d985c0560b2af4e44c0d.png

 

We therefore have an equivalence between our architecture and the expected one:

06c112c2f105321764d6bfd36c4697eaa5144ff43e1b0cf86c89588e0f825034.png

 

 

By requesting a backward to input trace on bit 2 of the display 3 we have the following diagram:

42155c127f29151542f4711c0a361b94d219f09e90eb3b76e5a1a080d53b57a8.png

With the RTL scheme we get the following Boolean expression:

 

8b75252db7ea6681711a2c2d2559b5e0f5195fec5797409ead3f22e634451490.jpg

With our architecture we had the following truth table:

9d64fc10f1bac4e84e43573cfbc87f1770ac7e21132c8ae87c5ffd8180409627.jpg

So we have :

1d3462d3f500256a3456df38e5749ab46c1ffe57a65fe2f0c8e04e28e3c95eb8.jpg

 

2.3 Logical optimization

We are now asking for circuit optimization. The operation of the optimization tool is mainly based on the design constraints of the block. We set a clock constraint of 1 MHz, an output delay of 0.3 ns on the output m. Finally, we specify all other inputs and outputs as asynchronous.
We have the following technological diagram:

7c425277beb8f81d07869760a5f5cf59098a27c4af5fba190c0498d087daf895.png

We carry out a report area on our optimization:

e93bda0e7282331a85ed61427d418a2f0364a973405001dc90d5addfe48ba2c3.jpg

 

We can see on this report area that the optimization that is carried out is a surface optimization. We observe that on this report, the use of the processor is mainly due to the I / O and is 10.68%, the rest is weakly based on the 2 LUTs and the 2 registers.


We visualize the critical path below, from the schematics panel:

064a41dfe02652a39be630d50a344ef483904693fd874fce3284592d3c150df9.png

The sequential part is in red, the combinatorial part is in blue.

413d5ae5753f6714c177533f647d642b737cc5ef4018e495d93206adfca8d18c.png

 

We have the following diagram, leading from the Mode input, to bit 2 of display 3.

b40a3df6229b5eb911ba5f4c9b99ff0854b65c40b0dcc78e640c87b480c12ee9.png

 

2.4. Routing placement

Physical testing of the circuit on the board's FPGA requires assigning the component legs to the model interface signals.

The following code is added in the declaration area of the BEH display architecture, so as to proceed with the assignment of the signals from the interface of the block to the legs of the FPGA, in accordance with the figure of the subject.

b00748acc0e496e869a8ba772f891ae62bba6762f99c7e7193cb5ab871ea277a.png

 

3. Synthesis from a command script

 

It is possible to run a script simulating the commands of the various tools of the synthesis flow. We define the synthesis script syntheseTP1.tcl below, taking up the different stages of the synthesis flow of the display block from the text commands.

 

7440860b70b4207b86137b9c23955f8b12f14fe32d5a7cc1f33fb22c6f87b5db.png

 

Through this script the legs are assigned to the different signals. For example, set_attribute –name pin_number –value Y23 -port -type string aff3 (3) -design rtl assigns pin Y23 to bit 3 of signal aff3.

 

4. FPGA circuit test

 

We now want to physically test our behavioral architecture on the FPGA of the Altera experiment board. The latter has the following characteristics:

 

d8ba835601182158f7d501fb9c897fda165a44eff59aedc8ae080c21f35736a3.png

 

Mode = 00:

e25b566f6d7d49fc945b57cbaaf1a59601a77124fef9a4f32d31d37a134228b0.jpg

The transmission mode is alternate (HD), with a speed of 800 bps.

 

Mode = 01:

5eab11878789565f40b8a2561d2dc89d97931061c821bc54b550633ada473a98.jpg

The transmission mode is alternate (HD), with a speed of 1200 bps.

 

Mode = 1X:

df9e21bcc4e2727ecb7a23580f7979bcac96b306c8220e709bc201cacd533d2e.jpg

The transmission mode is bidirectional (FD), with a rate of 400 bps.

By setting dtr to ‘0’, the transfer is not made, which is quite consistent.

 

5. Conclusion

 

Through this practical work we have described sequential and combinatorial blocks in behavioral form. We also saw the impact of the VHDL writing on the inference of the blocks from the BEH schema. We also obtained the technological diagram from the previous diagram. The performance of the implementation was analyzed. Finally, through the physical implementation and pin assignment of the circuit, we were able to test our code to finally display value on a seven-segment display.

How do you rate this article?

0



Electronics
Electronics

Some articles about things i learnt in my post-graduated school :)

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.