#######################################################################
|
#######################################################################
|
## File: int_ctrl.IP
|
## File: int_ctrl.IP
|
##
|
##
|
## Copyright (C) 2014-2016 Alireza Monemi
|
## Copyright (C) 2014-2019 Alireza Monemi
|
##
|
##
|
## This file is part of ProNoC 1.7.0
|
## This file is part of ProNoC 1.9.1
|
##
|
##
|
## 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 BEHAVIOR.
|
################################################################################
|
################################################################################
|
|
|
$ipgen = bless( {
|
$ipgen = bless( {
|
'file_name' => '/home/alireza/Mywork/mpsoc/src_peripheral/int_ctrl/int_ctrl.v',
|
'version' => 6,
|
'sockets' => {
|
'system_h' => '
|
'interrupt_peripheral' => {
|
#define ${IP}_MER (*((volatile unsigned int *) ($BASE )))
|
'connection_num' => 'single connection',
|
#define ${IP}_IER (*((volatile unsigned int *) ($BASE+4 )))
|
'value' => 'INT_NUM',
|
#define ${IP}_IAR (*((volatile unsigned int *) ($BASE+8 )))
|
'0' => {
|
#define ${IP}_IPR (*((volatile unsigned int *) ($BASE+12 )))
|
'name' => 'int_periph'
|
|
},
|
#define ${IP}_INT_NUM ${INT_NUM}
|
'interrupt_peripheral' => {},
|
|
'type' => 'param'
|
struct ihnd {
|
}
|
void (*handler)(void);
|
},
|
void *arg;
|
'parameters_order' => [
|
};
|
'INT_NUM',
|
|
'Dw',
|
/* Initialize routine */
|
'Aw',
|
int general_int_init (void);
|
'SELw'
|
|
|
/* Add interrupt handler */
|
|
int general_int_add(unsigned long irq, void (* handler)(), void *arg);
|
|
|
|
/* Disable interrupt */
|
|
int general_int_disable (unsigned long irq);
|
|
|
|
/* Enable interrupt */
|
|
int general_int_enable(unsigned long irq);
|
|
|
|
/* Main interrupt handler */
|
|
void general_int_main();
|
|
',
|
|
'hdl_files' => [
|
|
'/mpsoc/rtl/src_peripheral/int_ctrl/int_ctrl.v'
|
],
|
],
|
'ip_name' => 'int_ctrl',
|
|
'unused' => {
|
|
'plug:wb_slave[0]' => [
|
|
'tag_i',
|
|
'cyc_i',
|
|
'bte_i',
|
|
'cti_i'
|
|
]
|
|
},
|
|
'ports' => {
|
'ports' => {
|
'sa_dat_o' => {
|
'sa_dat_o' => {
|
'type' => 'output',
|
'type' => 'output',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'range' => 'Dw-1 : 0',
|
'intfc_port' => 'dat_o',
|
'intfc_port' => 'dat_o',
|
'range' => 'Dw-1 : 0'
|
'intfc_name' => 'plug:wb_slave[0]'
|
},
|
|
'sa_err_o' => {
|
|
'type' => 'output',
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
|
'intfc_port' => 'err_o',
|
|
'range' => ''
|
|
},
|
|
'clk' => {
|
|
'range' => '',
|
|
'intfc_port' => 'clk_i',
|
|
'intfc_name' => 'plug:clk[0]',
|
|
'type' => 'input'
|
|
},
|
|
'int_o' => {
|
|
'intfc_name' => 'plug:interrupt_cpu[0]',
|
|
'intfc_port' => 'int_o',
|
|
'range' => '',
|
|
'type' => 'output'
|
|
},
|
},
|
'sa_stb_i' => {
|
'sa_dat_i' => {
|
|
'range' => 'Dw-1 : 0',
|
|
'intfc_port' => 'dat_i',
|
'type' => 'input',
|
'type' => 'input',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]'
|
'range' => '',
|
|
'intfc_port' => 'stb_i'
|
|
},
|
},
|
'sa_rty_o' => {
|
'reset' => {
|
'type' => 'output',
|
'intfc_port' => 'reset_i',
|
'range' => '',
|
'range' => '',
|
'intfc_port' => 'rty_o',
|
'type' => 'input',
|
'intfc_name' => 'plug:wb_slave[0]'
|
'intfc_name' => 'plug:reset[0]'
|
},
|
},
|
'sa_sel_i' => {
|
'sa_sel_i' => {
|
'type' => 'input',
|
|
'intfc_port' => 'sel_i',
|
|
'range' => 'SELw-1 : 0',
|
'range' => 'SELw-1 : 0',
|
|
'intfc_port' => 'sel_i',
|
|
'type' => 'input',
|
'intfc_name' => 'plug:wb_slave[0]'
|
'intfc_name' => 'plug:wb_slave[0]'
|
},
|
},
|
'sa_ack_o' => {
|
'sa_err_o' => {
|
'type' => 'output',
|
|
'range' => '',
|
'range' => '',
|
'intfc_port' => 'ack_o',
|
'intfc_port' => 'err_o',
|
|
'type' => 'output',
|
'intfc_name' => 'plug:wb_slave[0]'
|
'intfc_name' => 'plug:wb_slave[0]'
|
},
|
},
|
|
'sa_stb_i' => {
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
|
'type' => 'input',
|
|
'intfc_port' => 'stb_i',
|
|
'range' => ''
|
|
},
|
'sa_we_i' => {
|
'sa_we_i' => {
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_port' => 'we_i',
|
|
'range' => '',
|
'range' => '',
|
|
'intfc_port' => 'we_i',
|
'type' => 'input'
|
'type' => 'input'
|
},
|
},
|
'reset' => {
|
'int_o' => {
|
'intfc_port' => 'reset_i',
|
|
'range' => '',
|
'range' => '',
|
'intfc_name' => 'plug:reset[0]',
|
'intfc_port' => 'int_o',
|
'type' => 'input'
|
'type' => 'output',
|
|
'intfc_name' => 'plug:interrupt_cpu[0]'
|
},
|
},
|
'sa_dat_i' => {
|
'sa_ack_o' => {
|
'intfc_port' => 'dat_i',
|
|
'range' => 'Dw-1 : 0',
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
'type' => 'input'
|
'intfc_port' => 'ack_o',
|
|
'range' => '',
|
|
'type' => 'output'
|
},
|
},
|
'sa_addr_i' => {
|
'sa_addr_i' => {
|
'type' => 'input',
|
|
'intfc_name' => 'plug:wb_slave[0]',
|
'intfc_name' => 'plug:wb_slave[0]',
|
|
'type' => 'input',
|
'range' => 'Aw-1 : 0',
|
'range' => 'Aw-1 : 0',
|
'intfc_port' => 'adr_i'
|
'intfc_port' => 'adr_i'
|
},
|
},
|
'int_i' => {
|
'int_i' => {
|
'intfc_port' => 'int_i',
|
'type' => 'input',
|
'range' => 'INT_NUM-1 : 0',
|
'range' => 'INT_NUM-1 : 0',
|
'intfc_name' => 'socket:interrupt_peripheral[array]',
|
'intfc_port' => 'int_i',
|
'type' => 'input'
|
'intfc_name' => 'socket:interrupt_peripheral[array]'
|
}
|
|
},
|
|
'version' => 1,
|
|
'plugs' => {
|
|
'wb_slave' => {
|
|
'0' => {
|
|
'width' => 5,
|
|
'addr' => '0x9e00_0000 0x9eff_ffff IDE Controller',
|
|
'name' => 'wb'
|
|
},
|
|
'type' => 'num',
|
|
'value' => 1,
|
|
'wb_slave' => {}
|
|
},
|
|
'reset' => {
|
|
'type' => 'num',
|
|
'0' => {
|
|
'name' => 'reset'
|
|
},
|
|
'value' => 1,
|
|
'reset' => {}
|
|
},
|
},
|
'clk' => {
|
'clk' => {
|
'clk' => {},
|
'intfc_name' => 'plug:clk[0]',
|
'value' => 1,
|
'intfc_port' => 'clk_i',
|
'type' => 'num',
|
'range' => '',
|
'0' => {
|
'type' => 'input'
|
'name' => 'clk'
|
},
|
|
'sa_rty_o' => {
|
|
'intfc_port' => 'rty_o',
|
|
'type' => 'output',
|
|
'range' => '',
|
|
'intfc_name' => 'plug:wb_slave[0]'
|
}
|
}
|
},
|
},
|
'interrupt_cpu' => {
|
'system_c' => '/* Interrupt handlers table */
|
'value' => 1,
|
struct ihnd int_handlers[${IP}_INT_NUM ];
|
'type' => 'num',
|
|
'0' => {
|
/* Initialize routine */
|
'name' => 'interrupt_cpu'
|
int general_int_init (void)
|
|
{
|
|
int i;
|
|
for(i = 0; i <${IP}_INT_NUM; i++) {
|
|
int_handlers[i].handler = 0;
|
|
int_handlers[i].arg = 0;
|
}
|
}
|
|
${IP}_IER=0;
|
|
${IP}_MER=0x3;
|
|
return 0;
|
|
}
|
|
|
|
|
|
/* Add interrupt handler */
|
|
int general_int_add(unsigned long irq, void (* handler)(void), void *arg)
|
|
{
|
|
if(irq >= ${IP}_INT_NUM) return -1;
|
|
int_handlers[irq].handler = handler;
|
|
int_handlers[irq].arg = arg;
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
/* Disable interrupt */
|
|
int general_int_disable (unsigned long irq)
|
|
{
|
|
if(irq >=${IP}_INT_NUM) return -1;
|
|
${IP}_IER &= ~(0x00000001L << irq);
|
|
return 0;
|
}
|
}
|
|
|
|
/* Enable interrupt */
|
|
int general_int_enable(unsigned long irq)
|
|
{
|
|
if(irq >= ${IP}_INT_NUM) return -1;
|
|
${IP}_IER |= (0x00000001L << irq);
|
|
return 0;
|
|
}
|
|
|
|
|
|
/* Main interrupt handler */
|
|
void general_int_main()
|
|
{
|
|
unsigned long i = 0;
|
|
unsigned long ipr =${IP}_IPR;
|
|
while(i < 32) {
|
|
if((ipr & (0x01L << i)) && (int_handlers[i].handler != 0)) {
|
|
(*int_handlers[i].handler)( ); //(int_handlers[i].arg);
|
|
}
|
|
i++;
|
|
}
|
|
${IP}_IAR = ipr; // Acknowledge all Interrupts
|
|
}
|
|
|
|
',
|
|
'modules' => {
|
|
'int_ctrl' => {}
|
},
|
},
|
'gui_status' => {
|
'gui_status' => {
|
'timeout' => 0,
|
'status' => 'ideal',
|
'status' => 'ideal'
|
'timeout' => 0
|
},
|
},
|
'modules' => {
|
'sockets' => {
|
'int_ctrl' => {}
|
'interrupt_peripheral' => {
|
|
'type' => 'param',
|
|
'0' => {
|
|
'name' => 'int_periph'
|
|
},
|
|
'interrupt_peripheral' => {},
|
|
'connection_num' => 'single connection',
|
|
'value' => 'INT_NUM'
|
|
}
|
},
|
},
|
'category' => 'Interrupt',
|
|
'module_name' => 'int_ctrl',
|
|
'description' => 'interrupt controller',
|
'description' => 'interrupt controller',
|
|
'ip_name' => 'int_ctrl',
|
|
'module_name' => 'int_ctrl',
|
|
'category' => 'Interrupt',
|
'parameters' => {
|
'parameters' => {
|
|
'Dw' => {
|
|
'content' => '',
|
|
'default' => ' 32',
|
|
'global_param' => 'Localparam',
|
|
'type' => 'Fixed',
|
|
'redefine_param' => 1,
|
|
'info' => undef
|
|
},
|
'INT_NUM' => {
|
'INT_NUM' => {
|
'global_param' => 0,
|
|
'info' => 'number of inerrupt.',
|
|
'content' => '1,32,1',
|
'content' => '1,32,1',
|
|
'default' => ' 3',
|
'type' => 'Spin-button',
|
'type' => 'Spin-button',
|
'default' => ' 3'
|
'global_param' => 'Localparam',
|
|
'redefine_param' => 1,
|
|
'info' => 'number of inerrupt.'
|
},
|
},
|
'SELw' => {
|
'SELw' => {
|
'type' => 'Fixed',
|
|
'default' => ' 4 ',
|
|
'global_param' => 0,
|
|
'content' => '',
|
'content' => '',
|
|
'default' => ' 4 ',
|
|
'global_param' => 'Localparam',
|
|
'type' => 'Fixed',
|
|
'redefine_param' => 1,
|
'info' => undef
|
'info' => undef
|
},
|
},
|
'Aw' => {
|
'Aw' => {
|
'type' => 'Fixed',
|
|
'default' => ' 3',
|
|
'global_param' => 0,
|
|
'info' => undef,
|
|
'content' => ''
|
|
},
|
|
'Dw' => {
|
|
'content' => '',
|
'content' => '',
|
'info' => undef,
|
'info' => undef,
|
'global_param' => 0,
|
'redefine_param' => 1,
|
'type' => 'Fixed',
|
'type' => 'Fixed',
|
'default' => ' 32'
|
'global_param' => 'Localparam',
|
|
'default' => ' 3'
|
}
|
}
|
},
|
},
|
'system_h' => '
|
'unused' => {
|
#define ${IP}_MER (*((volatile unsigned int *) ($BASE )))
|
'plug:wb_slave[0]' => [
|
#define ${IP}_IER (*((volatile unsigned int *) ($BASE+4 )))
|
'bte_i',
|
#define ${IP}_IAR (*((volatile unsigned int *) ($BASE+8 )))
|
'cti_i',
|
#define ${IP}_IPR (*((volatile unsigned int *) ($BASE+12 )))',
|
'tag_i',
|
'hdl_files' => [
|
'cyc_i'
|
'/mpsoc/src_peripheral/int_ctrl/int_ctrl.v'
|
|
]
|
]
|
|
},
|
|
'file_name' => 'mpsoc/rtl/src_peripheral/int_ctrl/int_ctrl.v',
|
|
'parameters_order' => [
|
|
'INT_NUM',
|
|
'Dw',
|
|
'Aw',
|
|
'SELw'
|
|
],
|
|
'plugs' => {
|
|
'wb_slave' => {
|
|
'wb_slave' => {},
|
|
'value' => 1,
|
|
'type' => 'num',
|
|
'0' => {
|
|
'addr' => '0x9e00_0000 0x9eff_ffff IDE Controller',
|
|
'name' => 'wb',
|
|
'width' => 5
|
|
}
|
|
},
|
|
'reset' => {
|
|
'type' => 'num',
|
|
'0' => {
|
|
'name' => 'reset'
|
|
},
|
|
'reset' => {},
|
|
'value' => 1
|
|
},
|
|
'clk' => {
|
|
'value' => 1,
|
|
'type' => 'num',
|
|
'clk' => {},
|
|
'0' => {
|
|
'name' => 'clk'
|
|
}
|
|
},
|
|
'interrupt_cpu' => {
|
|
'value' => 1,
|
|
'0' => {
|
|
'name' => 'interrupt_cpu'
|
|
},
|
|
'type' => 'num'
|
|
}
|
|
}
|
}, 'ip_gen' );
|
}, 'ip_gen' );
|
|
|