final_prj
final_prj
1. Requirement Specification
391
REGISTER ITEM LIST
393
Final Project Requirement
394
DETAIL FUNCTIONAL DESCRIPTION
Counter
Counter
64-bit count-up.
Counting mode:
o Default mode: counter’s speed is same as system clock.
o Control mode: when enabled by writing 1 to TCR.div_en bit, the counter's speed is determined by
the divisor value set in TCR.div_val
Counter continues counting when interrupts occurs.
Counter continues counting when overflow occurs.
[Standard only]: when timer_en is H->L, counter needs to be initialized by software. When timer_en is
L->H again, timer can work normally.
[Advanced] support halted mode describe in next page.
[Advanced] When timer_en changes from High to Low, the counter is cleared to its initial value. When
timer_en is L->H again, timer can work normally.
Note: the div_en and div_val is not related to frequency divisor (clock divider). Those settings only
control the counter when to count.
395
DETAIL FUNCTIONAL DESCRIPTION
Halted
1 2 3 4
1 2 3 4
396
DETAIL FUNCTIONAL DESCRIPTION
Timer Interrupt
Timer Interrupt
Timer interrupt (tim_int) is asserted (set) when interrupt is enabled and
counter’s value matches (equal) the compare value.
Once asserted, the timer interrupt (tim_int) remains unchange until it is cleared
by writing 1 to TISR.int_st bit or the interrupt is disabled.
397
DETAIL FUNCTIONAL DESCRIPTION
Counting Mode
Counting mode:
In default mode, counting speed depend on system clock (same as div_val=0 case as below waveform).
The counting’s speed can be controlled by register settings by setting into TCR.div_en and TCR.div_val[3:0]
as the register specification
div_en and div_val can not be changed during timer_en is High.
o Standard level: testbench should not change div_en and div_val.
o Advanced level: not allow to change div_en and div_val while timer_en is High by an error response
when user mistakenly accesses.
Example waveform of counter if control mode.
398
DETAIL FUNCTIONAL DESCRIPTION
APB slave / Register
399
REGISTER SUMMARY
400
REGISTER SPECIFICATION
Timer Control Register -TCR
[Advanced level]: value of this register is cleared to initial value when timer_en
changes from H->L.
402
REGISTER SPECIFICATION
Timer Data Register 1 –TDR1
[Advanced level]: value of this register is cleared to initial value when timer_en
changes from H->L.
403
REGISTER SPECIFICATION
Timer Compare Register 0 –TCMP0
404
REGISTER SPECIFICATION
Timer Compare Register 1 –TCMP1
405
REGISTER SPECIFICATION
Timer Interrupt Enable Register–TIER
406
REGISTER SPECIFICATION
Timer Interrupt Status Register–TISR
407
REGISTER SPECIFICATION
Timer Halt Control Status Register–THCSR
[Advanced level]
Timer halt acknowledge
0: timer is NOT halted
1: timer is halted
[Advanced level]
Timer halt request
0: no halt req.
1: timer is requested to halt.
408
IO Port List
Top module name: timer_top
Signal name Width Direction Description
sys_clk
sys_rst_n
tim_psel
tim_pwrite
tim_penable
tim_paddr Note: the address bit-width is calculated based on address space. The
bit-width must be enough to contain all the address in the address space
tim_pwdata
tim_prdata
tim_pstrb
tim_pready
tim_pslverr
tim_int
dbg_mode 409
RELEASE DATA FOR FINAL PROJECT
Release data:
Design:
Design spec full (Power Point or Word)
Clean RTL code
Verification
Verification plan (excel format)
Verification environment (testbench, script)
100% testcases passed with checker
Coverage report
o Standard level: 90%
o Advanced level: 100%
410