اطلاعیه

Collapse
No announcement yet.

ارور

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    ارور

    سلام
    کسی میدونه مشکل این برنامه چیه که ارور میده؟
    [code=vhdl]----------------------------------------------------------------------------------
    -- Company:
    -- Engineer:
    --
    -- Create Date: 1053 12/07/2015
    -- Design Name:
    -- Module Name: re2 - Behavioral
    -- Project Name:
    -- Target Devices:
    -- Tool versions:
    -- Description:
    --
    -- Dependencies:
    --
    -- Revision:
    -- Revision 0.01 - File Created
    -- Additional Comments:
    --
    ----------------------------------------------------------------------------------
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    use IEEE.STD_LOGIC_UNSIGNED.ALL;
    use IEEE.STD_LOGIC_ARITH.ALL;
    use ieee.numeric_std.all;
    -- Uncomment the following library declaration if using
    -- arithmetic functions with Signed or Unsigned values
    --use IEEE.NUMERIC_STD.ALL;

    -- Uncomment the following library declaration if instantiating
    -- any Xilinx primitives in this code.
    --library UNISIM;
    --use UNISIM.VComponents.all;

    entity re2 is
    Port ( inc : in STD_LOGIC;
    dec : in STD_LOGIC;
    Clk : in STD_LOGIC;
    onc : in STD_LOGIC;
    twc : in STD_LOGIC;
    clear : in STD_LOGIC;
    rash : in STD_LOGIC;
    lash : in STD_LOGIC;
    rcsh : in STD_LOGIC;
    lcsh : in STD_LOGIC;
    co : out STD_LOGIC_VECTOR (3 downto 0));
    end re2;

    architecture Behavioral of re2 is
    signal Dout_sig: STD_LOGIC_VECTOR(3 downto 0):="0000";
    begin

    process(Clk,Dout_sig)
    begin
    if Rising_edge(Clk)then
    if(inc='1&#039then
    Dout_sig<= Dout_sig+1;
    elsif dec='1' then
    Dout_sig<= Dout_sig-1;
    elsif onc='1' then
    Dout_sig<= (Dout_sig NAND "1111"
    elsif twc='1' then
    Dout_sig<= (Dout_sig NAND "1111&quot+1;
    elsif clear='1' then
    Dout_sig<= (others=>'0'
    elsif rash='1' then
    Dout_sig<= Dout_sig sra 1 ;
    elsif lash='1' then
    Dout_sig<= Dout_sig sla 1 ;
    elsif lcsh='1' then
    Dout_sig<= Dout_sig rol 1 ;
    elsif rcsh='1' then
    Dout_sig<= Dout_sig ror 1 ;

    end if;
    end if;
    co <= Dout_sig;
    end process;

    end Behavioral;


    [/code]


    ارور فقط توی شیفت هاست.
    [code=vhdl]ERROR:HDLParsers:808 - "C:/Users/Sima/Desktop/az memari/re2/re2.vhd" Line 66. sra can not have such operands in this context.
    ERROR:HDLParsers:808 - Line 68. sla can not have such operands in this context.
    ERROR:HDLParsers:808 - Line 70. rol can not have such operands in this context.
    ERROR:HDLParsers:808 - Line 72. ror can not have such operands in this context.
    [/code]

    #2
    پاسخ : ارور

    چرا این همه کتابخونه اضافه کردی :angry:
    به اینجا سر بزن :applause::
    http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/bit-shifts-in-vhdl.html
    من به جای این دستور از:
    کد:
    Dout_sig <= Dout_sig(0) & Dout_sig(7 downto 1);-- righ shift
    Dout_sig <= Dout_sig(6 downto 0) & Dout_sig(4);-- left shift
    استفاده می کنم. :eek:
    مهم نيست که کجايي هستي، چه رنگي هستي، به چه زبوني حرف مي زني. مهم اينه که انسان باشي.
    http://baranelec.mihanblog.com/
    آینده ای خواهم ساخت که گذشته ام در برابرش زانو بزند...

    دیدگاه


      #3
      پاسخ : ارور

      سلام.
      متاسفانه کتابخانه NUMERICAL مقداری مشکل داشته و نمی توان از توابع آن استفاده کرد.
      موفق باشین

      دیدگاه


        #4
        پاسخ : ارور

        سلام
        به نظر من numerical_std نه تنها مشکل نداره بلکه پیشنهاد میکنم همه از این library استفاده کنید.اما....
        نکته اول :
        قبل از استفاده باید library را کاملا مطالعه کنید.همه library ها در ادرس زیر هستند:
        C:\Xilinx\12.1\ISE_DS\ISE\vhdl\src\ieee
        به عنوان مثال در library فوق دستور rol فقط از نوع signed,unsigned پشتیبانی میکنه ولی شما std_logic_vector بهش دادی.
        با یکم دقت در library میتونی بهتر کد بزنی.
        نکته دوم:
        همیشه از یک library در کد استفاده کنید.

        یا علی

        دیدگاه


          #5
          پاسخ : ارور

          سلام
          من وریلاگ کار میکنم و زیاد VHDL نمیدونم
          اما اینا میدونم مهم نیست با چه زبانی سخت افزار را تعریف میکنیم برای همه باید یک اصولی را رعایت کنیم
          استفاده از چند elsif پشت سرم اصلا توصیه نمیشه بهتره به جای این همه elsif از یک case استفاده بشه
          ممکن هم هست مشکل از library هاتون باشه

          دیدگاه


            #6
            پاسخ : ارور

            نوشته اصلی توسط sima.b
            سلام
            کسی میدونه مشکل این برنامه چیه که ارور میده؟
            [code=vhdl]----------------------------------------------------------------------------------
            -- Company:
            -- Engineer:
            --
            -- Create Date: 1053 12/07/2015
            -- Design Name:
            -- Module Name: re2 - Behavioral
            -- Project Name:
            -- Target Devices:
            -- Tool versions:
            -- Description:
            --
            -- Dependencies:
            --
            -- Revision:
            -- Revision 0.01 - File Created
            -- Additional Comments:
            --
            ----------------------------------------------------------------------------------
            library IEEE;
            use IEEE.STD_LOGIC_1164.ALL;
            use IEEE.STD_LOGIC_UNSIGNED.ALL;
            use IEEE.STD_LOGIC_ARITH.ALL;
            use ieee.numeric_std.all;
            -- Uncomment the following library declaration if using
            -- arithmetic functions with Signed or Unsigned values
            --use IEEE.NUMERIC_STD.ALL;

            -- Uncomment the following library declaration if instantiating
            -- any Xilinx primitives in this code.
            --library UNISIM;
            --use UNISIM.VComponents.all;

            entity re2 is
            Port ( inc : in STD_LOGIC;
            dec : in STD_LOGIC;
            Clk : in STD_LOGIC;
            onc : in STD_LOGIC;
            twc : in STD_LOGIC;
            clear : in STD_LOGIC;
            rash : in STD_LOGIC;
            lash : in STD_LOGIC;
            rcsh : in STD_LOGIC;
            lcsh : in STD_LOGIC;
            co : out STD_LOGIC_VECTOR (3 downto 0));
            end re2;

            architecture Behavioral of re2 is
            signal Dout_sig: STD_LOGIC_VECTOR(3 downto 0):="0000";
            begin

            process(Clk,Dout_sig)
            begin
            if Rising_edge(Clk)then
            if(inc='1&#039then
            Dout_sig<= Dout_sig+1;
            elsif dec='1' then
            Dout_sig<= Dout_sig-1;
            elsif onc='1' then
            Dout_sig<= (Dout_sig NAND "1111"
            elsif twc='1' then
            Dout_sig<= (Dout_sig NAND "1111&quot+1;
            elsif clear='1' then
            Dout_sig<= (others=>'0'
            elsif rash='1' then
            Dout_sig<= Dout_sig sra 1 ;
            elsif lash='1' then
            Dout_sig<= Dout_sig sla 1 ;
            elsif lcsh='1' then
            Dout_sig<= Dout_sig rol 1 ;
            elsif rcsh='1' then
            Dout_sig<= Dout_sig ror 1 ;

            end if;
            end if;
            co <= Dout_sig;
            end process;

            end Behavioral;


            [/code]


            ارور فقط توی شیفت هاست.
            [code=vhdl]ERROR:HDLParsers:808 - "C:/Users/Sima/Desktop/az memari/re2/re2.vhd" Line 66. sra can not have such operands in this context.
            ERROR:HDLParsers:808 - Line 68. sla can not have such operands in this context.
            ERROR:HDLParsers:808 - Line 70. rol can not have such operands in this context.
            ERROR:HDLParsers:808 - Line 72. ror can not have such operands in this context.
            [/code]

            1 های اخر خطوطی که ارور داری چرا هستن؟
            اگه منظورت اشاره به بیت های سیگنال بوده، باید تو پرانتز باشه
            خدا گفت : به جهنم ببریدش، او برگشت و با تعجب به خدا نگاه کرد. خدا گفت : به بهشت ببریدش. فرشتگان پرسیدند: چرا؟! خدا گفت : او هنوز به من امیدوار است...

            دیدگاه

            لطفا صبر کنید...
            X