Line 1... |
Line 1... |
#######################################################################
|
#######################################################################
|
## File: timer.IP
|
## File: timer.IP
|
##
|
##
|
## Copyright (C) 2014-2016 Alireza Monemi
|
## Copyright (C) 2014-2016 Alireza Monemi
|
##
|
##
|
## This file is part of ProNoC 1.5.0
|
## This file is part of ProNoC 1.7.0
|
##
|
##
|
## WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT
|
## WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT
|
## MAY CAUSE UNEXPECTED BEHAIVOR.
|
## MAY CAUSE UNEXPECTED BEHAIVOR.
|
################################################################################
|
################################################################################
|
|
|
$timer = bless( {
|
$timer = bless( {
|
'hdl_files' => [
|
'system_h' => '#define ${IP}_TCSR (*((volatile unsigned int *) ($BASE )))
|
'/mpsoc/src_peripheral/timer/timer.v'
|
|
],
|
|
'system_h' => '#define ${IP}_TCSR0 (*((volatile unsigned int *) ($BASE )))
|
|
|
|
/*
|
/*
|
//timer control register
|
//timer control register
|
TCSR0
|
TCSR
|
bit
|
bit
|
6-3 : clk_dev_ctrl
|
PRESCALER WIDTH+3:4 : clk_dev_ctrl
|
3 : timer_isr
|
3 : timer_isr
|
2 : rst_on_cmp_value
|
2 : rst_on_cmp_value
|
1 : int_enble_on_cmp_value
|
1 : int_enble_on_cmp_value
|
0 : timer enable
|
0 : timer enable
|
*/
|
*/
|
#define ${IP}_TLR0 (*((volatile unsigned int *) ($BASE+4 )))
|
#define ${IP}_TLR (*((volatile unsigned int *) ($BASE+4 )))
|
#define ${IP}_TCMP0 (*((volatile unsigned int *) ($BASE+8 )))
|
#define ${IP}_TCMR (*((volatile unsigned int *) ($BASE+8 )))
|
#define ${IP}_EN (1 << 0)
|
#define ${IP}_EN (1 << 0)
|
#define ${IP}_INT_EN (1 << 1)
|
#define ${IP}_INT_EN (1 << 1)
|
#define ${IP}_RST_ON_CMP (1 << 2)
|
#define ${IP}_RST_ON_CMP (1 << 2)
|
',
|
//Initialize the timer. Enable the timer, reset on compare value, and interrupt
|
'ip_name' => 'timer',
|
void ${IP}_int_init ( unsigned int compare ){
|
'description' => '32 bit timer ',
|
${IP}_TCMR = compare;
|
|
${IP}_TCSR = ( ${IP}_EN | ${IP}_INT_EN | ${IP}_RST_ON_CMP);
|
|
}
|
|
|
|
#define ${IP}_start() ${IP}_TCSR|=${IP}_EN
|
|
#define ${IP}_stop() ${IP}_TCSR&=~${IP}_EN
|
|
#define ${IP}_reset() ${IP}_TLR=0
|
|
#define ${IP}_read() ${IP}_TLR',
|
'gui_status' => {
|
'gui_status' => {
|
'status' => 'ideal',
|
'timeout' => 0,
|
'timeout' => 0
|
'status' => 'ideal'
|
},
|
},
|
'parameters' => {
|
'parameters' => {
|
'Aw' => {
|
'CNTw' => {
|
'info' => undef,
|
'default' => '32 ',
|
'deafult' => '3',
|
'type' => 'Fixed',
|
'global_param' => 'Localparam',
|
'global_param' => 'Localparam',
|
'content' => '',
|
'content' => '',
|
'type' => 'Fixed',
|
'info' => undef,
|
'redefine_param' => 1
|
'redefine_param' => 1
|
},
|
},
|
'TAGw' => {
|
'Dw' => {
|
'info' => undef,
|
'default' => '32',
|
'deafult' => '3',
|
|
'global_param' => 'Localparam',
|
|
'content' => '',
|
|
'type' => 'Fixed',
|
'type' => 'Fixed',
|
|
'content' => '',
|
|
'global_param' => 'Localparam',
|
|
'info' => undef,
|
'redefine_param' => 1
|
'redefine_param' => 1
|
},
|
},
|
'SELw' => {
|
'SELw' => {
|
'info' => undef,
|
|
'deafult' => '4',
|
|
'global_param' => 'Localparam',
|
|
'content' => '',
|
'content' => '',
|
|
'global_param' => 'Localparam',
|
|
'redefine_param' => 1,
|
|
'info' => undef,
|
'type' => 'Fixed',
|
'type' => 'Fixed',
|
'redefine_param' => 1
|
'default' => '4'
|
},
|
},
|
'Dw' => {
|
'TAGw' => {
|
|
'redefine_param' => 1,
|
'info' => undef,
|
'info' => undef,
|
'deafult' => '32',
|
|
'global_param' => 'Localparam',
|
'global_param' => 'Localparam',
|
'content' => '',
|
'content' => '',
|
'type' => 'Fixed',
|
'type' => 'Fixed',
|
'redefine_param' => 1
|
'default' => '3'
|
},
|
},
|
'CNTw' => {
|
'PRESCALER_WIDTH' => {
|
'info' => undef,
|
'type' => 'Spin-button',
|
'deafult' => '32 ',
|
'default' => '8',
|
|
'redefine_param' => 1,
|
|
'info' => ' The prescaler timer width. The prescaler takes the basic timer clock frequency and divides it by some value before feeding it to the timer, according to how the prescaler register(s) are configured.
|
|
|
|
|
|
',
|
|
'global_param' => 'Parameter',
|
|
'content' => '1,32,1'
|
|
},
|
|
'Aw' => {
|
'global_param' => 'Localparam',
|
'global_param' => 'Localparam',
|
'content' => '',
|
'content' => '',
|
|
'redefine_param' => 1,
|
|
'info' => undef,
|
'type' => 'Fixed',
|
'type' => 'Fixed',
|
'redefine_param' => 1
|
'default' => '3'
|
}
|
}
|
},
|
},
|
'modules' => {
|
'module_name' => 'timer',
|
'timer' => {}
|
'description' => 'A simple, general purpose, Wishbone bus-based, 32-bit timer.',
|
},
|
'sockets' => {},
|
|
'hdl_files' => [
|
|
'/mpsoc/src_peripheral/timer/timer.v'
|
|
],
|
|
'category' => 'Timer',
|
|
'parameters_order' => [
|
|
'CNTw',
|
|
'Dw',
|
|
'Aw',
|
|
'TAGw',
|
|
'SELw',
|
|
'PRESCALER_WIDTH'
|
|
],
|
'plugs' => {
|
'plugs' => {
|
'reset' => {
|
|
'reset' => {},
|
|
'value' => 1,
|
|
'0' => {
|
|
'name' => 'reset'
|
|
},
|
|
'type' => 'num'
|
|
},
|
|
'interrupt_peripheral' => {
|
'interrupt_peripheral' => {
|
|
'type' => 'num',
|
'interrupt_peripheral' => {},
|
'interrupt_peripheral' => {},
|
|
'value' => 1,
|
'0' => {
|
'0' => {
|
'name' => 'intrp'
|
'name' => 'intrp'
|
|
}
|
},
|
},
|
'value' => 1,
|
'wb_slave' => {
|
'type' => 'num'
|
'type' => 'num',
|
|
'wb_slave' => {},
|
|
'0' => {
|
|
'addr' => '0x9600_0000 0x96ff_ffff PWM/Timer/Counter Ctrl',
|
|
'width' => 5,
|
|
'name' => 'wb'
|
},
|
},
|
'clk' => {
|
'value' => 1
|
'clk' => {},
|
},
|
|
'reset' => {
|
|
'reset' => {},
|
'value' => 1,
|
'value' => 1,
|
'0' => {
|
'0' => {
|
'name' => 'clk'
|
'name' => 'reset'
|
},
|
},
|
'type' => 'num'
|
'type' => 'num'
|
},
|
},
|
'wb_slave' => {
|
'clk' => {
|
|
'clk' => {},
|
|
'type' => 'num',
|
'0' => {
|
'0' => {
|
'width' => 5,
|
'name' => 'clk'
|
'name' => 'wb',
|
|
'addr' => '0x9600_0000 0x96ff_ffff PWM/Timer/Counter Ctrl'
|
|
},
|
},
|
'value' => 1,
|
'value' => 1
|
'type' => 'num',
|
|
'wb_slave' => {}
|
|
}
|
}
|
},
|
},
|
'parameters_order' => [
|
'unused' => {
|
'CNTw',
|
'plug:wb_slave[0]' => [
|
'Dw',
|
'cti_i',
|
'Aw',
|
'bte_i'
|
'TAGw',
|
]
|
'SELw'
|
},
|
],
|
|
'ports' => {
|
'ports' => {
|
'sa_tag_i' => {
|
'sa_we_i' => {
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
|
'intfc_port' => 'we_i',
|
|
'type' => 'input',
|
|
'range' => ''
|
|
},
|
|
'sa_tag_i' => {
|
'intfc_port' => 'tag_i',
|
'intfc_port' => 'tag_i',
|
'range' => 'TAGw-1 : 0',
|
'range' => 'TAGw-1 : 0',
|
'type' => 'input'
|
'type' => 'input',
|
|
'intfc_name' => 'plug:wb_slave[0]'
|
},
|
},
|
'sa_dat_o' => {
|
'sa_stb_i' => {
|
|
'range' => '',
|
|
'type' => 'input',
|
|
'intfc_port' => 'stb_i',
|
|
'intfc_name' => 'plug:wb_slave[0]'
|
|
},
|
|
'sa_addr_i' => {
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_port' => 'dat_o',
|
'intfc_port' => 'adr_i',
|
'range' => 'Dw-1 : 0',
|
'type' => 'input',
|
'type' => 'output'
|
'range' => 'Aw-1 : 0'
|
},
|
},
|
'sa_rty_o' => {
|
'irq' => {
|
'intfc_port' => 'rty_o',
|
'intfc_name' => 'plug:interrupt_peripheral[0]',
|
|
'range' => '',
|
|
'type' => 'output',
|
|
'intfc_port' => 'int_o'
|
|
},
|
|
'reset' => {
|
|
'intfc_name' => 'plug:reset[0]',
|
|
'type' => 'input',
|
|
'range' => '',
|
|
'intfc_port' => 'reset_i'
|
|
},
|
|
'sa_err_o' => {
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'range' => '',
|
'range' => '',
|
'type' => 'output'
|
'type' => 'output',
|
|
'intfc_port' => 'err_o'
|
},
|
},
|
'sa_sel_i' => {
|
'sa_sel_i' => {
|
'intfc_name' => 'plug:wb_slave[0]',
|
|
'intfc_port' => 'sel_i',
|
|
'range' => 'SELw-1 : 0',
|
'range' => 'SELw-1 : 0',
|
'type' => 'input'
|
'type' => 'input',
|
},
|
'intfc_port' => 'sel_i',
|
'sa_dat_i' => {
|
'intfc_name' => 'plug:wb_slave[0]'
|
'intfc_port' => 'dat_i',
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
|
'range' => 'Dw-1 : 0',
|
|
'type' => 'input'
|
|
},
|
},
|
'sa_we_i' => {
|
'sa_rty_o' => {
|
'intfc_port' => 'we_i',
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
|
'type' => 'output',
|
'range' => '',
|
'range' => '',
|
'type' => 'input'
|
'intfc_port' => 'rty_o'
|
},
|
},
|
'irq' => {
|
'sa_dat_i' => {
|
'intfc_port' => 'int_o',
|
|
'intfc_name' => 'plug:interrupt_peripheral[0]',
|
|
'range' => '',
|
|
'type' => 'output'
|
|
},
|
|
'sa_err_o' => {
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_port' => 'err_o',
|
'type' => 'input',
|
'range' => '',
|
'range' => 'Dw-1 : 0',
|
'type' => 'output'
|
'intfc_port' => 'dat_i'
|
},
|
},
|
'sa_cyc_i' => {
|
'sa_cyc_i' => {
|
'intfc_port' => 'cyc_i',
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'range' => '',
|
'intfc_port' => 'cyc_i',
|
'type' => 'input'
|
'type' => 'input',
|
|
'range' => ''
|
},
|
},
|
'clk' => {
|
'clk' => {
|
'intfc_name' => 'plug:clk[0]',
|
|
'intfc_port' => 'clk_i',
|
'intfc_port' => 'clk_i',
|
'range' => '',
|
'range' => '',
|
'type' => 'input'
|
'type' => 'input',
|
|
'intfc_name' => 'plug:clk[0]'
|
},
|
},
|
'reset' => {
|
'sa_dat_o' => {
|
'intfc_name' => 'plug:reset[0]',
|
|
'intfc_port' => 'reset_i',
|
|
'range' => '',
|
|
'type' => 'input'
|
|
},
|
|
'sa_ack_o' => {
|
|
'intfc_port' => 'ack_o',
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
|
'range' => '',
|
|
'type' => 'output'
|
|
},
|
|
'sa_addr_i' => {
|
|
'intfc_port' => 'adr_i',
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'range' => 'Aw-1 : 0',
|
'range' => 'Dw-1 : 0',
|
'type' => 'input'
|
'type' => 'output',
|
|
'intfc_port' => 'dat_o'
|
},
|
},
|
'sa_stb_i' => {
|
'sa_ack_o' => {
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_port' => 'stb_i',
|
'type' => 'output',
|
'range' => '',
|
'range' => '',
|
'type' => 'input'
|
'intfc_port' => 'ack_o'
|
}
|
}
|
},
|
},
|
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/timer/timer.v',
|
'modules' => {
|
'sockets' => {},
|
'timer' => {}
|
'module_name' => 'timer',
|
|
'unused' => {
|
|
'plug:wb_slave[0]' => [
|
|
'cti_i',
|
|
'bte_i'
|
|
]
|
|
},
|
},
|
'category' => 'Timer'
|
'version' => 9,
|
|
'ip_name' => 'timer',
|
|
'description_pdf' => '/mpsoc/src_peripheral/timer/timer.pdf',
|
|
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/timer/timer.v'
|
}, 'ip_gen' );
|
}, 'ip_gen' );
|