Forum: FPGA, VHDL & Co. Probleme beim erstellen der richtigen Funktionslogik


von Heiko B. (2deep)


Angehängte Dateien:

Lesenswert?

Hi,

ich schreibe gerade an einem Programm das Anhand der Eingangssignale:
H-Sync , V-Sync, DE
analysiert, welche Auflösung gewählt ist.
D.h. totalPix, totalLines, activePix, Hor-FrontPorch etc....

eigentlich klappt alles schon ganz gut bis auf die analyse des 
Vertcial-FrontPorch.

Und da ist mein Problem, ich komme gerade auf keine Logik um die 
Funktion richtig zu beschreiben.

Ich habe folgende zwei Prozesse geschrieben aber wie gesagt, das Ziel 
ist dadurch noch nicht erreicht.
1
-- ##### Vertical FrontPorch ##### --
2
3
  process (analysisReset, analysisHSync)
4
    variable counter             : std_logic_vector (2 downto 0);
5
    variable var_enableVerticalFrontPorch  : std_logic;
6
    
7
8
  begin
9
10
    if analysisReset = '1' then
11
      tempVerticalFrontPorch      <= (others => '0');
12
      counter              := (others => '0');
13
      var_enableVerticalFrontPorch  := '0';
14
      internVerticalFrontPorch    <= (others => '0');
15
    elsif analysisHSync = '0' and analysisHSync'event then
16
      if enableVerticalFrontPorch = '1' then
17
        counter            := counter +1;
18
        internVerticalFrontPorch  <= counter;
19
      elsif enableVerticalFrontPorch = '0' and var_enableVerticalFrontPorch = '1' then
20
        internVerticalFrontPorch   <= internVerticalFrontPorch +1;
21
        tempVerticalFrontPorch    <= internVerticalFrontPorch;  
22
        counter           := b"000";
23
      end if;
24
      var_enableVerticalFrontPorch  := enableVerticalFrontPorch;
25
    end if;
26
  
27
  end process;  
28
29
30
31
-- ##### Supportprocess for Horizontal FrontPorch ##### --
32
33
  process (analysisReset, analysisClk)
34
    variable var_analysisDE    : std_logic;
35
    variable var_analysisHSync  : std_logic;
36
37
  begin
38
    
39
    if analysisReset = '1' then
40
      var_analysisDE        := '0';
41
      var_analysisHSync      := '0';
42
      enableHorizontalFrontPorch  <= '0';
43
    elsif analysisClk = '0' and analysisClk'event then
44
      if analysisDE = '0' and var_analysisDE = '1' and analysisHSync = '0' then
45
        enableHorizontalFrontPorch  <= '1';
46
      elsif analysisHSync = '1' and var_analysisHSync = '0' and analysisDE = '0' then
47
        enableHorizontalFrontPorch  <= '0';
48
      end if;
49
    var_analysisDE    := analysisDE;
50
    var_analysisHSync  := analysisHSync;
51
    end if;
52
  
53
  end process;


das problem an den von mir geschriebenen prozessen ist das jedes H-Sync 
gezählt wird und nicht nur die zwischen denen DE = '0' ist ... aber wie 
gesagt ich weiss gerade auch nicht wie ich es umsetzen soll.

Hoffe jemand von euch hat nen guten Einfall

viele grüße

Heiko

von Thomas R. (Firma: abaxor engineering) (abaxor)


Lesenswert?

Du musst dir merken, ob DE innerhalb einer Zeile gesetzt wurde. Wenn 
nein inkrementierst du deinen Frontporchzähler bei der steigenden 
HSync-Flanke.

Du verwendest in zwei Prozessen schon zwei verschiedene Takte, was dir 
Probleme bringen wird. Sicher gibt es noch einen Prozess der mit clk_g 
läuft, um totalpix auszuzählen, oder?

Du musst alles mit clk_g takten.

Tom

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.