Changeset 9911


Ignore:
Timestamp:
08/30/10 16:01:15 (14 years ago)
Author:
weitzel
Message:
FTU rate counting modified; now synthesis works
Location:
firmware/FTU
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • firmware/FTU/FTU_control.vhd

    r9890 r9911  
    147147            FTU_control_State <= INIT;
    148148          elsif (ram_ada_cntr < (NO_OF_ENABLE*RAM_ADDR_RATIO + NO_OF_COUNTER*RAM_ADDR_RATIO + (NO_OF_DAC - NO_OF_DAC_NOT_USED)*RAM_ADDR_RATIO)) then  -- default DACs
    149             if (ram_ada_cntr < NO_OF_ENABLE*RAM_ADDR_RATIO + NO_OF_COUNTER*RAM_ADDR_RATIO + (NO_OF_DAC - NO_OF_DAC_NOT_USED - 1)*RAM_ADDR_RATIO) then
     149            if (ram_ada_cntr < (NO_OF_ENABLE*RAM_ADDR_RATIO + NO_OF_COUNTER*RAM_ADDR_RATIO + (NO_OF_DAC - NO_OF_DAC_NOT_USED - 1)*RAM_ADDR_RATIO)) then
    150150              if (ram_ada_cntr mod 2 = 0) then
    151151                ram_dia_sig <= conv_std_logic_vector(DEFAULT_DAC((ram_ada_cntr - (NO_OF_ENABLE*RAM_ADDR_RATIO + NO_OF_COUNTER*RAM_ADDR_RATIO)) / 2),16)(7 downto 0);
     
    322322  detect_new_rates: process(new_rates, new_rates_busy)
    323323  begin
    324     if (new_rates_busy = '0' and rising_edge(new_rates)) then
     324    if(new_rates_busy = '1') then
     325      new_rates_sig <= '0';
     326    elsif rising_edge(new_rates) then
    325327      new_rates_sig <= '1';
    326     else
    327       new_rates_sig <= '0';
    328328    end if;
    329329  end process detect_new_rates;
  • firmware/FTU/FTU_top.vhd

    r9890 r9911  
    205205  attribute syn_black_box : boolean;
    206206  attribute syn_black_box of FTU_dual_port_ram: component is true;
     207  -- avoid "black box" warning during synthesis
     208  attribute box_type : string;
     209  attribute box_type of FTU_dual_port_ram: component is "black_box";
    207210 
    208211begin
     
    215218  enables_D <= enable_array_sig(3)(8 downto 0);
    216219
    217   new_rates_sig <= new_rate_A_sig and new_rate_B_sig and new_rate_C_sig and new_rate_D_sig and new_rate_t_sig; 
     220  new_rates_sig <= new_rate_A_sig and new_rate_B_sig and new_rate_C_sig and new_rate_D_sig and new_rate_t_sig;
    218221 
    219222  --differential input buffer for patch A
  • firmware/FTU/counter/FTU_rate_counter.vhd

    r9890 r9911  
    7575  begin
    7676
    77     if rising_edge(cntr_reset) then
    78      
    79       --formula to calculate counting period from prescaling value
    80       if (prescaling = "00000000") then
    81         counting_period <= COUNTER_FREQUENCY / (2 * CNTR_FREQ_DIVIDER);
    82       else
    83         counting_period <= ((conv_integer(unsigned(prescaling)) + 1) / 2) * (COUNTER_FREQUENCY / CNTR_FREQ_DIVIDER);
    84       end if;
    85      
     77    if cntr_reset = '1' then
     78         
    8679      clk_cntr := 0;     
    8780      period_finished <= '1';
     
    9184     
    9285    elsif rising_edge(clk_1M_sig) then
     86     
    9387      if (clk_cntr < counting_period - 1) then
    9488        clk_cntr := clk_cntr + 1;
     
    107101  process(trigger, period_finished)
    108102  begin
    109     if rising_edge(period_finished) then
     103    if period_finished = '1' then
    110104      trigger_counts <= 0;
    111105      overflow_sig <= '0';
     
    118112          overflow_sig <= '1';
    119113        end if;
     114      end if;
     115    end if;
     116  end process;
     117
     118  process(cntr_reset, prescaling)
     119  begin
     120    if rising_edge(cntr_reset) then
     121      --formula to calculate counting period from prescaling value
     122      if (prescaling = "00000000") then
     123        counting_period <= COUNTER_FREQUENCY / (2 * CNTR_FREQ_DIVIDER);
     124      else
     125        counting_period <= ((conv_integer(unsigned(prescaling)) + 1) / 2) * (COUNTER_FREQUENCY / CNTR_FREQ_DIVIDER);
    120126      end if;
    121127    end if;
Note: See TracChangeset for help on using the changeset viewer.