OpenCores
URL https://opencores.org/ocsvn/sdhc-sc-core/sdhc-sc-core/trunk

Subversion Repositories sdhc-sc-core

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /sdhc-sc-core/trunk
    from Rev 129 to Rev 130
    Reverse comparison

Rev 129 → Rev 130

/src/grpSd/unitSdClockMaster/0in/csl_ctrl.vhd
0,0 → 1,9
entity csl_ctrl is
end entity;
 
architecture ctrl of csl_ctrl is
begin
-- 0in set_clock iClk -default
-- 0in default_reset iRstSync -active_high -sync
end ctrl;
 
/src/grpSd/unitSdClockMaster/0in/Makefile
0,0 → 1,31
prove: psl_analyze psl_compile psl_prove
 
confirm: psl_analyze psl_compile psl_confirm
 
psl_analyze:
0in -od SFV_PSL_VH -cmd analyze \
-vhdl ../../../grpGlobal/pkgGlobal/src/Global-p.vhdl \
../src/SdClockMaster-e.vhdl \
../src/SdClockMaster-Rtl-a.vhdl \
-work zwork -libmap zwork=zwork
 
psl_compile:
0in -od SFV_PSL_VH -cmd csl -d SdClockMaster \
-work zwork -libmap zwork=zwork \
-pslfile_vh ../src/SdClockMaster.psl \
-vhctrl csl_ctrl.vhd \
-eode
 
psl_prove:
0in_prove +0in_od+SFV_PSL_RESULTS_VH \
+0in_dir+SFV_PSL_VH/0in_cache \
+0in_effort+high
 
psl_confirm:
0in_confirm +0in_od+SFV_PSL_RESULTS_VH \
+0in_dir+SFV_PSL_VH/0in_cache \
+0in_effort+high
 
clean:
\rm -rf work zwork *.wlf *.log replay* transcript *.db *.fcdb \
SFV_PSL_VH SFV_PSL_RESULTS_VH
/src/grpSd/unitSdClockMaster/src/tbSdClockMaster-Bhv-ea.vhdl
40,12 → 40,14
 
stimuli : process
begin
iHighSpeed <= cActivated after 1000 ns,
cInactivated after 1025 ns,
cActivated after 1305 ns;
iHighSpeed <= cActivated after 1001 ns,
cInactivated after 1026 ns,
cActivated after 1306 ns;
 
iDisable <= cActivated after 2345 ns;
Finished <= true after 5000 ns;
iDisable <= cActivated after 2346 ns,
cInactivated after 3001 ns,
cActivated after 3423 ns;
Finished <= true after 5001 ns;
wait;
end process stimuli;
 
/src/grpSd/unitSdClockMaster/src/SdClockMaster-Rtl-a.vhdl
50,47 → 50,61
 
-- defaults
 
NxR <= R;
NxR.Counter <= R.Counter + 1;
NxR <= R;
 
-- generate clock and strobe
case R.HighSpeed is
when cInactivated => -- default mode
NxR.Clk <= R.Counter(1);
case iDisable is
when cInactivated =>
NxR.Counter <= R.Counter + 1;
 
case R.Counter is
when "00" | "01" | "11" =>
NxR.Strobe <= cInactivated;
-- generate clock and strobe
case R.HighSpeed is
when cInactivated => -- default mode
NxR.Clk <= R.Counter(1);
 
when "10" =>
NxR.Strobe <= cActivated;
case R.Counter is
when "00" | "01" | "11" =>
NxR.Strobe <= cInactivated;
 
when "10" =>
NxR.Strobe <= cActivated;
 
when others =>
NxR.Strobe <= 'X';
end case;
 
when cActivated => -- High-Speed mode
NxR.Clk <= R.Counter(0);
NxR.Strobe <= not R.Counter(0);
 
when others =>
NxR.Strobe <= 'X';
NxR.Clk <= 'X';
end case;
 
when cActivated => -- High-Speed mode
NxR.Clk <= R.Counter(0);
NxR.Strobe <= not R.Counter(0);
-- switch speeds and increment counter
case R.HighSpeed is
when cInactivated =>
if (R.Counter = 3) then
NxR.HighSpeed <= iHighSpeed;
end if;
 
when others =>
NxR.Clk <= 'X';
end case;
when cActivated =>
if (R.Counter(0) = '1') then
NxR.HighSpeed <= iHighSpeed;
NxR.Counter <= "00";
end if;
 
-- switch speeds
case R.HighSpeed is
when cInactivated =>
if (R.Counter = 3) then
NxR.HighSpeed <= iHighSpeed;
end if;
when others =>
NxR.HighSpeed <= 'X';
end case;
 
when cActivated =>
if (R.Counter(0) = '1') then
NxR.HighSpeed <= iHighSpeed;
end if;
-- disable strobes and do not increment the counter
NxR.Strobe <= cInactivated;
 
when others =>
NxR.HighSpeed <= 'X';
NxR.Clk <= 'X';
NxR.Strobe <= 'X';
 
end case;
 
end process Comb;
/src/grpSd/unitSdClockMaster/src/SdClockMaster.psl
4,12 → 4,13
default clock is (iClk'event and iClk='1');
 
-- strobe at least one clock cycle before falling edge
assert always ({oSdStrobe} |=> {(not oSdStrobe) ; (not oSdStrobe and oSdCardClk)[*] ; not oSdCardClk});
assert always ({oSdStrobe} |=> {not oSdStrobe; (not oSdStrobe and oSdCardClk)[*]; not oSdCardClk}) abort iRstSync;
 
-- check speed
assert always ({iHighSpeed and oSdCardClk} |=> {not oSdCardClk; oSdCardClk});
-- check oSdCardClk
-- assert always (not oSdCardClk -> eventually! oSdCardClk) abort iDisable;
assert always (not oSdCardClk -> { (not oSdCardClk)[*]; oSdCardClk}) abort iDisable;
 
-- check disable
assert always ({iDisable} |=> not oSdCardClk and not oSdStrobe);
assert always ({iDisable} |=> not oSdStrobe);
}
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.