verilog en vhdl
Répondre à la discussion
Affichage des résultats 1 à 8 sur 8

verilog en vhdl



  1. #1
    Bartacus

    verilog en vhdl


    ------

    Bonjour,

    Mon objectif est de programmer un capteur d'image en vhdl. Pour cela je suis parti d'un fichier exemple.. mais il est en verilog.

    Code:
    `define N_EXT_ADDR 26
    
    module socTop (
        pbRstN,
        poRstN,
        flashRstN,
        sysClk,
        rs232Atx,
        rs232Arx,
        extAddr,
        extData,
        flashHiCeN,
        flashLoCeN,
        flashWeN,
        flashOeN,
        sramCeN,
        sramBsN,
        sramWeN,
        sramOeN,
        ledOut,
        switchIn,
    
        UJTAG_UJTAG_TCK,
        UJTAG_UJTAG_TDI,
        UJTAG_UJTAG_TMS,
        UJTAG_UJTAG_TRSTB,
        UJTAG_UJTAG_TDO,
    /*
        JTCK,
        JTDI,
        JTMS,
        JRTCK,
        JTDO,
    */
        sysClk_16MHz,
        pllLock,
        dummyIn,
        dummyOut
        ); /* synthesis syn_global_buffers = 10 */
    
    // I/O definitions:
    
        // System clocks:
        input  sysClk;
    
        // Resets:
        input  pbRstN;                  // external reset connected to pushbutton
        input  poRstN;                  // external reset not connected to pushbutton
        output flashRstN;               // reset to FLASH
    
        // RS232 connections:
        output rs232Atx;                // serial transmit line
        input  rs232Arx;                // serial receive line
    
        // External FLASH/RAM signals:
        inout  [31:0] extData;          // bidirectional data to external devices
        output [`N_EXT_ADDR-1:2] extAddr;
    
        output flashHiCeN;
        output flashLoCeN;
        output flashWeN;
        output flashOeN;
        output sramCeN;
        output [3:0] sramBsN;           // SRAM Byte Select signals
        output sramWeN;
        output sramOeN;
    
        // Switches, LEDs
        output [9:0] ledOut;
        input  [9:0] switchIn;
    
        // JTAG for FlashPro3 connector
    
        input UJTAG_UJTAG_TCK;
        input UJTAG_UJTAG_TDI;
        input UJTAG_UJTAG_TMS;
        input UJTAG_UJTAG_TRSTB;
        output UJTAG_UJTAG_TDO;
    
    /*
        // ICE Debug connector
        input JTCK;
        input JTDI;
        input JTMS;
        output JRTCK;
        output JTDO;
    */
    
        // Pll signals
        output sysClk_16MHz;
        output pllLock;
    
        // Dummy signals
        input  dummyIn;
        output dummyOut;
    
    // Declarations:
    
        // Clocks, Resets
        wire sysClk_48MHz;
        wire sysClk_16MHz;
        wire poRstNi;
        wire pbRstNi;
    
        // APB slave interface
        wire HRESETN;
    
        wire [31:0] APBmslave0_PRDATA;
        wire [23:0] APBmslave0_PADDR;
        wire APBmslave0_PENABLE;
        wire APBmslave0_PSELx;
        wire [31:0] APBmslave0_PWDATA;
        wire APBmslave0_PWRITE;
    
        // GPIO signals
        wire [9:0] gpioDataIn;
        wire [9:0] gpioDataOut;
    
        // ARM debugger
        wire nTDOEN;
        wire JTDOi;
    
        // External memories
        wire [27:0] memAddr;
        wire flashCeN;
        wire flashOeN;
        wire sramOeN;
    
        // Remap
        wire Remap;
    
        // Switch 
        wire [9:0] switchInSync;
    
    // Assignments:
    
        // Keep these from being unused inputs
        assign dummyOut = dummyIn;
    
        // Connect LEDs & switches to GPIO
        assign ledOut = gpioDataOut;
        assign gpioDataIn = switchInSync;
    /*
        // ICE debugger
        assign JTDO = nTDOEN ? 1'bZ : JTDOi;
    */
        // External memories
        assign flashRstN = pbRstNi;
        assign flashHiCeN = flashCeN;
        assign flashLoCeN = flashCeN;
        assign extAddr[`N_EXT_ADDR-1:2] = memAddr[`N_EXT_ADDR-3:0];
        //assign memOeN = flashOeN & sramOeN;
    
        // Remap
        assign Remap = ~switchInSync[9]; //Note that switchIn[9] governs remapping
    
    // Instantiations:
    
        // Global resources for clock, reset
        actel_pll_48MHz_16MHz pll1 (.POWERDOWN(poRstNi), .CLKA(sysClk_48MHz), .LOCK(pllLock), .GLA(sysClk_16MHz));
        CLKINT ci0 (.A(sysClk),      .Y(sysClk_48MHz));
        CLKINT ci1 (.A(poRstN),      .Y(poRstNi));
        CLKINT ci2 (.A(pbRstN),      .Y(pbRstNi));
    
    
        // Instantiate Cortex-M1 Subsystem:
        Example_M1A3PL_UJTAG Example_M1A3PL_UJTAG_00(
            // Inputs
            .CoreUARTapbRX          (rs232Arx),
            .gpioDataIn             (gpioDataIn),
            .HCLK                   (sysClk_16MHz),
            .NSYSRESET              (pbRstNi),
            .UJTAG_UJTAG_TCK        (UJTAG_UJTAG_TCK),
            .UJTAG_UJTAG_TDI        (UJTAG_UJTAG_TDI),
            .UJTAG_UJTAG_TMS        (UJTAG_UJTAG_TMS),
            .UJTAG_UJTAG_TRSTB      (UJTAG_UJTAG_TRSTB),                
            .Remap(Remap),
            // Outputs
            .CoreUARTapbTX          (rs232Atx),
            .gpioDataOut            (gpioDataOut),
            .ExternalMemoryInterface_FlashCSN   (flashCeN),
            .ExternalMemoryInterface_FlashOEnN  (flashOeN),
            .ExternalMemoryInterface_FlashWEnN  (flashWeN),
            .ExternalMemoryInterface_MemAddr    (memAddr),
            .ExternalMemoryInterface_MemReadN   (),
            .ExternalMemoryInterface_MemWriteN  (),
            .ExternalMemoryInterface_SramByteN  (sramBsN),
            .ExternalMemoryInterface_SramCSN    (sramCeN),
            .ExternalMemoryInterface_SramClk    (),
            .ExternalMemoryInterface_SramOEnN   (sramOeN),
            .ExternalMemoryInterface_SramWEnN   (sramWeN),
            .HRESETn                (HRESETN),
            .UJTAG_UJTAG_TDO        (UJTAG_UJTAG_TDO),        
            // Inouts
            .ExternalMemoryInterface_MemData    (extData)
        );
    
        sync #(10) sync0
        (
            .outClk      (sysClk_16MHz),
            .outRstN     (HRESETN),
            .asyncInput  (switchIn),
            .syncOutput  (switchInSync)
        );
    endmodule
    Voila se que donne ma conversion (elle ne marche pas)

    Code:
    library IEEE;
     
    use IEEE.BIT_1164.all;
    use IEEE.BIT_arith.all;
    use IEEE.BIT_unsigned.all;
     
    ENTITY mt9v034 is 
    PORT (
     
        sysClk                  :IN BIT;
        pbRstN                  :IN BIT;          -- external reset connected to pushbutton
        poRstN                  :IN BIT;          -- external reset not connected to pushbutton
        rs232Arx                :IN BIT;          -- serial receive line
        LVDS                    :IN BIT;
        UJTAG_UJTAG_TCK         :IN BIT;          -- JTAG for FlashPro3 connector
        UJTAG_UJTAG_TDI         :IN BIT;
        UJTAG_UJTAG_TMS         :IN BIT;
        UJTAG_UJTAG_TRSTB       :IN BIT;
        dummyIN                 :IN BIT;          -- Dummy signals
        switchIN                :IN BIT;
     
        flashRstN               :OUT BIT;
        rs232Atx                :OUT BIT;         -- serial transmit line
        flashHiCeN              :OUT BIT;
        flashLoCen              :OUT BIT;
        flashWeN                :OUT BIT;
        flashOeN                :OUT BIT;   
        sramCeN                 :OUT BIT;
        sramBsn                 :OUT BIT;         -- SRAM Byte Select signals
        sramWeN                 :OUT BIT;
        sramOeN                 :OUT BIT;
        dataOut                 :OUT BIT_vector(9 downto 0);
        UJTAG_UJTAG_TDO         :OUT BIT;
        sysClk_26_6MHZ          :OUT BIT;         -- Pll signals
        pllLock                 :OUT BIT;         -- Pll signals
        dummyOut                :OUT BIT;         -- Dummy signals
     
     
        extData : INOUT BIT_VECTOR(31 downto 0);            -- bidirectional data to external devices
        extAddr : OUT BIT_VECTOR(25 downto 2)
     
     
    );
    END mt9v034;
     
     
    ARCHITECTURE proasic3l OF mt9v034 IS 
     
        -- Clocks, Resets
        signal sysClk_48MHz                 : BIT;
        signal sysClk_16MHz                 : BIT;
        signal poRstNi                      : BIT;
        signal pbRstNi                      : BIT;
     
        -- APB slave interface
        signal HRESETN                      : BIT;
        signal APBmslave0_PENABLE           : BIT;   
        signal APBmslave0_PSELx             : BIT;    
        signal APBmslave0_PWRITE            : BIT;
     
        -- ARM debugger
        signal nTDOEN                       : BIT;
        signal JTDOi                        : BIT;
        signal flash_CeN                    : BIT;
        signal flash_OeN                    : BIT;
        signal sram_OeN                     : BIT;
        signal Remap                        : BIT;
     
        -- APB slave interface
        signal APBmslave0_PRDATA            : BIT_vector(31 downto 0);
        signal APBmslave0_PADDR             : BIT_vector(23 downto 0);
        signal APBmslave0_PWDATA            : BIT_vector(31 downto 0);
     
        -- GPIO signals
        signal gpioDataIn                   : BIT;
        signal gpioDataOut                  : BIT_vector(9 downto 0);
     
        -- External memories
        signal memAddr                      : BIT_vector(27 downto 0);
        
        signal switchInSync                 : BIT;
    
        component actel_pll_48MHz_16MHz
        port(
           POWERDOWN  : IN BIT;
           CLKA       : IN BIT;
           LOCK       : OUT BIT;
           GLA        : OUT BIT       
        );
        end component;
    
        component CLKINT
        port(
           A  : IN BIT;
           Y  : OUT BIT
        );
        end component;
    
        component sync0
        port (
            asyncInput    : IN BIT;
            outClk        : OUT BIT;
            outRstN       : OUT BIT;
            syncOutput    : OUT BIT
        );
        end component;
    
        component mt9v034 
        port (
            component inst_mt9v034 
        port (
        CoreUARTapbRX                           : IN BIT;           
        RESET                                   : IN BIT;                      
        HCLK                                    : IN BIT;                        
        NSYSRESET                               : IN BIT;                  
        UJTAG_UJTAG_TCK                         : IN BIT;            
        UJTAG_UJTAG_TDI                         : IN BIT;           
        UJTAG_UJTAG_TMS                         : IN BIT;            
        UJTAG_UJTAG_TRSTB                       : IN BIT;
        CoreUARTapbTX                           : OUT BIT;
        gpioDataOut                             : OUT BIT_vector(9 downto 0);
        ExternalMemoryInterface_FlashCSN        : OUT BIT;
        ExternalMemoryInterface_FlashOEnN       : OUT BIT;
        ExternalMemoryInterface_FlashWEnN       : OUT BIT;
        ExternalMemoryInterface_MemAddr         : OUT BIT_vector(27 downto 0);
        ExternalMemoryInterface_SramByteN       : OUT BIT; 
        ExternalMemoryInterface_SramCSN         : OUT BIT;
        ExternalMemoryInterface_SramOEnN        : OUT BIT;
        ExternalMemoryInterface_SramWEnN        : OUT BIT;
        HRESETn                                 : OUT BIT;
        UJTAG_UJTAG_TDO                         : OUT BIT;
        ExternalMemoryInterface_MemData         : INOUT BIT_VECTOR(31 downto 0)
        );
        end component;
        );
        end component;
    
    
     
    BEGIN
     
        dummyOut <= dummyIn;        -- Keep these from being unused inputs
     
        dataOut <= gpioDataOut;
     
        gpioDataIn <= switchInSync;
     
        --External memories
        flashRstN <= pbRstNi;
        flashHiCeN <= flash_CeN;
        flashLoCeN <= flash_CeN;
        extAddr(25 downto 2) <= memAddr(23 downto 0);
     
        Remap <= not(switchInSync);
     
     
     --Instanciations:
     
        -- Global resources for clock, reset
        pll1 : actel_pll_48MHz_16MHz
        port map
        (
           POWERDOWN     => poRstNi,
           CLKA          => sysClk_48MHz,
           LOCK          => pllLock,
           GLA           => sysClk_16MHz
        );
        
        ci0 : CLKINT
        port map
        (
           A             => sysClk,
           Y             => sysClk_48MHz
        );
     
        ci1 : CLKINT
        port map
        (
           A             => poRstN,
           Y             => poRstNi
        );
     
        ci2 : CLKINT
        port map
        (
           A             => poRstN,
           Y             => pbRstNi
        );
     
        --Instantiate Cortex-M1 Subsystem:
        mt9v034 : inst_mt9v034
        port map 
        (
        --Inputs
        CoreUARTapbRX               => rs232Arx,
        RESET                       => gpioDataIn,
        HCLK                        => sysClk_16MHz,
        NSYSRESET                   => pbRstNi,
        UJTAG_UJTAG_TCK             => UJTAG_UJTAG_TCK,
        UJTAG_UJTAG_TDI             => UJTAG_UJTAG_TDI,
        UJTAG_UJTAG_TMS             => UJTAG_UJTAG_TMS,
        UJTAG_UJTAG_TRSTB           => UJTAG_UJTAG_TRSTB,
        --Outputs
        CoreUARTapbTX                       => rs232Atx,
        gpioDataOut                         => gpioDataOut,
        ExternalMemoryInterface_FlashCSN    => flashCeN,
        ExternalMemoryInterface_FlashOEnN   => flashOeN,
        ExternalMemoryInterface_FlashWEnN   => flashWeN,
        ExternalMemoryInterface_MemAddr     => memAddr,
        --ExternalMemoryInterface_MemReadN  => ,
        --ExternalMemoryInterface_MemWriteN =>,
        ExternalMemoryInterface_SramByteN   => sramBsN,
        ExternalMemoryInterface_SramCSN     => sramCeN,
        --ExternalMemoryInterface_SramClk   =>,
        ExternalMemoryInterface_SramOEnN    => sramOeN,
        ExternalMemoryInterface_SramWEnN    => sramWeN,
        HRESETn                             => HRESETN,
        UJTAG_UJTAG_TDO                     => UJTAG_UJTAG_TDO,
        --Inouts
        ExternalMemoryInterface_MemData    =>extData
        );
        
        sync : sync0
        port map
        (
        outClk                      => sysClk_16MHz,
        outRstN                     => HRESETN,
        asyncInput                  => switchIn,
        syncOutput                  => switchInSync
        );
     
    END proasic3l;
    Un peu long mais je compte sur vous ^^'

    Merci

    Bartacus

    -----

  2. #2
    indri

    Re : verilog en vhdl

    C'est le jeu des 7 erreurs?
    1er-Je vois dataout en vhd mais pas en verilog

    C'est quoi tout les components? des truks généré automatiquement? tu les as regénéré en vhdl?

    ps: c'est illisible le verilog
    Là où va le vent...

  3. #3
    Bartacus

    Re : verilog en vhdl

    Dataout représente ledout en verilog.
    Pour les components lorsque j'ai voulus faire l'instanciation sa m'a indiqué une erreur. Il n'y a que si je crée ces components que sa marche.

    Pour être peut-être plus clair mon but est de convertir ce dossier en vhdl: "M1A3PL-DEV-KIT Design Files"
    http://www.actel.com/products/hardwa...proasic3l.aspx

    Merci pour ta réponse

  4. #4
    indri

    Re : verilog en vhdl

    Citation Envoyé par Bartacus Voir le message
    Il n'y a que si je crée ces components que sa marche.
    Ben logique...tu demande de compiler quelque chose qui n'existe pas..
    Là où va le vent...

  5. A voir en vidéo sur Futura
  6. #5
    Bartacus

    Re : verilog en vhdl

    Dans ce cas je suis obligé de les créer ?
    Dans le verilog il n'existe pas non plus si ?

  7. #6
    Bartacus

    Re : verilog en vhdl

    Pour dire vrai je ne comprends pas vraiment se que fais ce fichier Soctop. J'ai l'impression qu'il réorganise l'ensemble des fichiers.

    Si quelqu'un pouvait également m'expliquer le rôle de la partie "instanciations" dans ce fichier vérilog svp ?

    Merci pour votre aide.

  8. #7
    indri

    Re : verilog en vhdl

    ben l''instanciation c'est assigner les signaux aux composants...

    mettre les fils aux pins des ci si tu préfères..

    obligé de les créer? ben oui, tjr avec la même analogie, tu fais un circuit mais tu mets juste les supports de ci, pas les ci, ton circuit ne petera pas des flammes!
    Là où va le vent...

  9. #8
    Bartacus

    Re : verilog en vhdl

    D'accord. Le problème c'est que ce fichier est un exemple et que je ne comprends absolument pas comment il est fait :s

    Voici une image de l'espace de travail avec à gauche le verilog et à droite se que j'ai fais en VHDL:

    Nom : verilog_vhdl.jpg
Affichages : 123
Taille : 603,9 Ko

    J'ai juste importé le schema du verilog et j'ai par la suite généré les composants (qui se retrouve codé en vhdl) pour avoir ceci.
    Celui que j'essai d'importer dans le VHDL c'est le Soctop du verilog.

    encore une fois merci.

Discussions similaires

  1. Modulation Numerique en Verilog/VHDL
    Par invite1ecdad30 dans le forum Électronique
    Réponses: 6
    Dernier message: 22/11/2011, 09h49
  2. convertir une instruction de verilog en vhdl
    Par invite8c6f844d dans le forum Électronique
    Réponses: 6
    Dernier message: 26/07/2009, 22h56
  3. Point flottant en VHDL et vhdl-200x
    Par invite6eee6b27 dans le forum Logiciel - Software - Open Source
    Réponses: 0
    Dernier message: 02/09/2008, 19h47
  4. VHDL ou VERILOG
    Par invite6d675053 dans le forum Électronique
    Réponses: 3
    Dernier message: 23/07/2008, 09h35
  5. convertisseur verilog/vhdl...
    Par Crepuscule2 dans le forum Électronique
    Réponses: 2
    Dernier message: 10/05/2008, 17h59
Découvrez nos comparatifs produits sur l'informatique et les technologies.