EmbDev.net

Forum: FPGA, VHDL & Verilog problem in vhdl code


von agathepower (Guest)


Attached files:

Rate this post
useful
not useful
Hi everyone!

I'm writing a vhdl code for the system in attachment. I have no error 
when I compile the code but I have an error when I elaborate.

ncelab: *E,CSGMSS: multiple sources for unresolved signal: INT1 
[4.3.1.2].
           Computing driving value: 
:systeme_comparateur_tb(archi):uut@systeme_c
omparateur(archi):int1
In port map at: ../sources/systeme_comparateur_arch.vhdl, line: 95, 
position: 34

This is my code below:
1
library ieee;
2
use ieee.std_logic_1164.all;
3
4
library analogdevice_lib;
5
use analogdevice_lib.all;
6
7
library st_lib;
8
use st_lib.all;
9
10
entity systeme_comparateur is
11
12
  port(enable_mux4_comp1,
13
       enable_mux8_comp1,
14
       enable_mux4_comp2,
15
       enable_mux8_comp2 : in std_logic;
16
       A_mux4_comp1,
17
       A_mux4_comp2      : in std_logic_vector (1 downto 0);
18
       A_mux8_comp1,
19
       A_mux8_comp2      : in std_logic_vector (2 downto 0);
20
       S_mux4_comp1,
21
       S_mux4_comp2      : in real_vector (3 downto 0);
22
       S_mux8_comp1,
23
       S_mux8_comp2      : in real_vector (7 downto 0);
24
       In_switch        : in std_logic;
25
       Sortie_comp1,
26
       Sortie_comp2      : out real);   
27
28
end systeme_comparateur;
29
30
31
architecture archi of systeme_comparateur is
32
33
component analog_ADG704
34
35
  generic (INPUTS_SEL: integer);
36
  
37
  port(EN : in std_logic;
38
       A  : in std_logic_vector (INPUTS_SEL-1 downto 0);
39
       S  : in real_vector (2**INPUTS_SEL-1 downto 0);
40
       D  : out real);
41
       
42
end component;
43
44
component analog_ADG708
45
46
  generic (INPUTS_SEL: integer);
47
  
48
  port(EN : in std_logic;
49
       A  : in std_logic_vector (INPUTS_SEL-1 downto 0);
50
       S  : in real_vector (2**INPUTS_SEL-1 downto 0);
51
       D  : out real);
52
       
53
end component;
54
55
component analog_comparateur
56
57
  generic (vcc   : real;
58
     gnd   : real);  
59
60
  port(in_pos : in real;
61
       in_neg : in real;
62
             s_comp : out real);   
63
64
end component;
65
66
component analog_ADG712_1
67
       
68
  port(In_ADG_1: in std_logic;
69
             D_ADG_1:  in real;
70
       S_ADG_1:  out real);
71
      
72
end component;
73
74
signal int1, int2, int3, int4 : real;
75
76
begin
77
78
  mux4_comp1:   analog_ADG704
79
  
80
            generic map (INPUTS_SEL => 2)
81
  
82
        port map (enable_mux4_comp1,
83
                                            A_mux4_comp1,
84
                                            S_mux4_comp1,
85
                                            int1);
86
      
87
  mux8_comp1:   analog_ADG708
88
  
89
        generic map (INPUTS_SEL => 3)
90
      
91
        port map (enable_mux8_comp1,
92
                                            A_mux8_comp1,
93
                                            S_mux8_comp1,
94
                                            int2);
95
      
96
  comp1:    analog_comparateur
97
  
98
        generic map (vcc => 5.0, gnd => 0.0)
99
      
100
        port map (int1, int2, Sortie_comp1);
101
102
  mux4_comp2:   analog_ADG704
103
  
104
            generic map (INPUTS_SEL => 2)
105
  
106
        port map (enable_mux4_comp2,
107
                                            A_mux4_comp2,
108
                                            S_mux4_comp2,
109
                                            int3);
110
      
111
  mux8_comp2:   analog_ADG708
112
  
113
        generic map (INPUTS_SEL => 3)
114
        
115
        port map (enable_mux8_comp2,
116
                                            A_mux8_comp2,
117
                                            S_mux8_comp2,
118
                                            int4);
119
      
120
  comp2:    analog_comparateur
121
  
122
        generic map (vcc => 5.0, gnd => 0.0)
123
      
124
        port map (int3, int4, Sortie_comp2);
125
      
126
  switch:    analog_ADG712_1
127
    
128
        port map (In_switch, int3, int1);
129
      
130
end archi;


With this code, I can't run a simulation. So I think I'm wrong when I 
connect the ports of ADG712 component with the rest of the system.

Could you help me please ?

von PittyJ (Guest)


Rate this post
useful
not useful
mux4_comp1:   analog_ADG704

            generic map (INPUTS_SEL => 2)

        port map (enable_mux4_comp1,
                                            A_mux4_comp1,
                                            S_mux4_comp1,
                                            int1);
....
       switch:    analog_ADG712_1

        port map (In_switch, int3, int1);


int1 is used as out signal from 2 components?

von agathepower (Guest)


Rate this post
useful
not useful
I use int1 signal to modelise the wire between ADG704 (U127) output and 
TS3021ILT (U126) positive input. So, if you get a look on the schema, 
there is the port '3' of ADG712 (U152A) which is also connected on this 
wire. I don't know if it's correct...

von PittyJ (Guest)


Rate this post
useful
not useful
not.  as far as I know.

von agathepower (Guest)


Rate this post
useful
not useful
Any idea to code that?? If it's possible^^

von PittyJ (Guest)


Rate this post
useful
not useful
I think, you have to create a new components, which takes two inputs 
(both int1) and creates one resulting signal.
You have to specify the best way how to combine both signals(and, or , 
sum, select). It depends on your goals.

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
agathepower wrote:
> component analog_ADG704
>   generic (INPUTS_SEL: integer);
>   port(EN : in std_logic;
>        A  : in std_logic_vector (INPUTS_SEL-1 downto 0);
>        S  : in real_vector (2**INPUTS_SEL-1 downto 0);
>        D  : out real);
>
> component analog_ADG712_1
>   port(In_ADG_1: in std_logic;
>        D_ADG_1:  in real;
>        S_ADG_1:  out real);

The models of the switches are wrong. According to the datasheet, all of 
the S are inout and also D is inout.
How do the models reflect the state "switch off"/"all switches off" to 
the d output? Is there a 'Z' level possible on the output (as it will be 
in reality)? How do you resolve the conflict when one switch drives 'Z' 
and another switch drives "3.3" on the same wire?

All in all you cann say: the VHDL description is not equal to the 
schematic, because in a switch both terminals are inout and a switch can 
be high-Z (just "open").
All in all I would say that you will need a special type for the 
"analog" signals. You need a type thats possible to reflect the high-Z 
value of an open switch. So have a look at this switch model (google 
translate will help out):
http://www.lothar-miller.de/s9y/archives/91-Schalter-und-Bruecke.html
Maybe it gives you a hint how to build such a switch.

: Edited by Moderator
von agathepower (Guest)


Attached files:

Rate this post
useful
not useful
Hi and thank you for your answer!

Lothar Miller wrote:
> The models of the switches are wrong. According to the datasheet, all of
> the S are inout and also D is inout.


I know, in fact the code in your link is working with std_logic but not 
with real. I already tested that. With real the error "multiple sources 
for unresolved signal" occurs in elaboration.

To pass through this issue I modelise only D to S, that why I have D:in 
and S:out in my code, because according to my tutor in this system there 
is only one possible sens.

If we imagine that not a ADG712 component but just a switch with an 
input, an output, and a command signal, how can I connect these ports 
with the rest of the system without error?

I put the schemas in attachment

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
agathepower wrote:
> If we imagine that not a ADG712 component but just a switch with an
> input, an output, and a command signal, how can I connect these ports
> with the rest of the system without error?
You can't implement a switch for real numbers. Just try to tell me: 
what would be on the output of this switch, if the input is 1.11 and the 
switch is on?
And what would be the output when the switch is switched off?
Why isn't it possible to handle this second case with a real value?

The only possibility you have is to implement a 2:1 multiplexer. That 
can be done with a real number. And the input of that mux is either the 
output of the lower mux and the output of the upper opamp in your 
sketches...

BTW: I scaled down your images size by a factor of 30 without any loss 
of information.

: Edited by Moderator
von agathepower (Guest)


Rate this post
useful
not useful
Lothar Miller wrote:
> The only possibility you have is to implement a 2:1 multiplexer

Thank you, I think that is the right solution.

Nothing to do with it, but I have an other question. Is it possible to 
connect an internal signal to a "bit" of a vector (not a bit but I don't 
know how to say it with "real") ?
In fact I want to connect signals generator on each S inputs of each 
mux. I have already the signal generator, it's an entity with no input 
and one output, this output is connected to an internal signal and this 
signal is connected to a "bit" of S vector on each mux.

I don't know if I'm clear...

Thank you for your help

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.