Skip to content

Commit da03744

Browse files
author
marqs
committed
update compilation settings
* add flash clock definition on SDC * add RF exp related clocks on SDC * update bram function attributes
1 parent ddf0657 commit da03744

File tree

8 files changed

+55
-41
lines changed

8 files changed

+55
-41
lines changed

ossc_pro.qsf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ set_global_assignment -name UNIPHY_SEQUENCER_DQS_CONFIG_ENABLE ON
629629

630630
set_global_assignment -name SMART_RECOMPILE ON
631631

632-
set_global_assignment -name SEED 1
632+
set_global_assignment -name SEED 2
633633

634634
set_global_assignment -name STRATIXIII_UPDATE_MODE REMOTE
635635

@@ -667,4 +667,5 @@ set_global_assignment -name QIP_FILE rtl/lpm_mult_sl.qip
667667
set_global_assignment -name QIP_FILE rtl/dc_fifo_emif_wr.qip
668668
set_global_assignment -name QIP_FILE rtl/pll_sdp.qip
669669
set_global_assignment -name SIP_FILE rtl/pll_sdp.sip
670+
670671
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

ossc_pro.sdc

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ create_clock -period 5MHz -name bck_hdmirx [get_ports HDMIRX_I2S_BCK_i]
1515

1616
if {$legacy_av_in} {
1717
create_clock -period 27MHz -name pclk_sdp [get_ports EXT_IO_A_io[0]]
18+
create_clock -period 24.576MHz -name bck_extpcm [get_ports EXT_IO_B_io[12]]
1819
}
1920

2021
create_generated_clock -source {sys_inst|pll_0|altera_pll_i|general[0].gpll~FRACTIONAL_PLL|refclkin} -divide_by 2 -multiply_by 88 -duty_cycle 50.00 -name pll_0_vco {sys_inst|pll_0|altera_pll_i|general[0].gpll~FRACTIONAL_PLL|vcoph[0]}
@@ -26,13 +27,16 @@ create_generated_clock -source {u_pll_sdp|pll_sdp_inst|altera_pll_i|general[0].g
2627

2728
create_generated_clock -name sd_clk -divide_by 2 -source {sys_inst|pll_0|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk} [get_pins sys:sys_inst|sdc_controller_top:sdc_controller_0|sdc_controller:sdc0|sd_clock_divider:clock_divider0|SD_CLK_O|q]
2829

30+
create_generated_clock -name flash_clk -divide_by 2 -source {sys_inst|pll_0|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk} [get_pins sys:sys_inst|sys_intel_generic_serial_flash_interface_top_0:intel_generic_serial_flash_interface_top_0|sys_intel_generic_serial_flash_interface_top_0_qspi_inf_inst:qspi_inf_inst|flash_clk_reg|q]
31+
2932
# output clocks
3033
#set pclk_out_port [get_ports HDMITX_PCLK_o]
3134
set i2s_bck_out_port [get_ports HDMITX_I2S_BCK_o]
3235
#create_generated_clock -name pclk_out -master_clock pclk_isl -source [get_ports ISL_PCLK_i] -multiply_by 1 $pclk_out_port
3336
#create_generated_clock -name pclk_out -master_clock pclk_hdmirx -source [get_ports HDMIRX_PCLK_i] -multiply_by 1 $pclk_out_port
34-
#create_generated_clock -name bck_out -master_clock bck_pcm -source [get_ports PCM_I2S_BCK_i] -multiply_by 1 $i2s_bck_out_port
35-
create_generated_clock -name bck_out -master_clock bck_hdmirx -source [get_ports HDMIRX_I2S_BCK_i] -multiply_by 1 $i2s_bck_out_port
37+
create_generated_clock -name bck_pcm_out -master_clock bck_pcm -source [get_ports PCM_I2S_BCK_i] -multiply_by 1 $i2s_bck_out_port
38+
create_generated_clock -name bck_hdmirx_out -master_clock bck_hdmirx -source [get_ports HDMIRX_I2S_BCK_i] -multiply_by 1 $i2s_bck_out_port -add
39+
create_generated_clock -name bck_extpcm_out -master_clock bck_extpcm -source [get_ports EXT_IO_B_io[12]] -multiply_by 1 $i2s_bck_out_port -add
3640
create_generated_clock -name sd_clk_out -master_clock sd_clk -source [get_pins sys:sys_inst|sdc_controller_top:sdc_controller_0|sdc_controller:sdc0|sd_clock_divider:clock_divider0|SD_CLK_O|q] -multiply_by 1 [get_ports {SD_CLK_o}]
3741

3842
# retrieve post-mapping clkmux output pin
@@ -68,7 +72,7 @@ derive_clock_uncertainty
6872

6973
set_clock_groups -asynchronous -group \
7074
{clk27} \
71-
{clk108 sd_clk sd_clk_out} \
75+
{clk108 sd_clk sd_clk_out flash_clk} \
7276
{clk148p5} \
7377
{pclk_isl pclk_isl_postmux} \
7478
{pclk_isl_postmux_div2} \
@@ -78,8 +82,10 @@ set_clock_groups -asynchronous -group \
7882
{pclk_sdp_postmux_div2} \
7983
{pclk_si pclk_si_out pclk_si_out_vga} \
8084
{pclk_si_div2} \
81-
{si_clk_extra} \
82-
{bck_hdmirx bck_pcm bck_out}
85+
{bck_pcm bck_pcm_out} \
86+
{bck_hdmirx bck_hdmirx_out} \
87+
{bck_extpcm bck_extpcm_out} \
88+
{si_clk_extra}
8389

8490

8591
### IO delays ###
@@ -126,8 +132,12 @@ foreach_in_collection c [get_clocks pclk_*_out] {
126132
set_output_delay -clock $c -clock_fall -max $hdmitx_dmax $hdmitx_data_outputs -add_delay
127133
}
128134

129-
set_output_delay -clock bck_out -min $hdmitx_dmin [get_ports {HDMITX_I2S_WS_o HDMITX_I2S_DATA_o}] -add_delay
130-
set_output_delay -clock bck_out -max $hdmitx_dmax [get_ports {HDMITX_I2S_WS_o HDMITX_I2S_DATA_o}] -add_delay
135+
set_output_delay -clock bck_pcm_out -min $hdmitx_dmin [get_ports {HDMITX_I2S_WS_o HDMITX_I2S_DATA_o}] -add_delay
136+
set_output_delay -clock bck_pcm_out -max $hdmitx_dmax [get_ports {HDMITX_I2S_WS_o HDMITX_I2S_DATA_o}] -add_delay
137+
set_output_delay -clock bck_hdmirx_out -min $hdmitx_dmin [get_ports {HDMITX_I2S_WS_o HDMITX_I2S_DATA_o}] -add_delay
138+
set_output_delay -clock bck_hdmirx_out -max $hdmitx_dmax [get_ports {HDMITX_I2S_WS_o HDMITX_I2S_DATA_o}] -add_delay
139+
set_output_delay -clock bck_extpcm_out -min $hdmitx_dmin [get_ports {HDMITX_I2S_WS_o HDMITX_I2S_DATA_o}] -add_delay
140+
set_output_delay -clock bck_extpcm_out -max $hdmitx_dmax [get_ports {HDMITX_I2S_WS_o HDMITX_I2S_DATA_o}] -add_delay
131141
set_false_path -to [get_ports {HDMITX_SPDIF_o HDMITX_5V_EN_o}]
132142

133143
# extra_av_out
@@ -153,6 +163,9 @@ if {$legacy_av_in} {
153163
set sdp_inputs [get_ports {EXT_IO_B_io[0] EXT_IO_B_io[3] EXT_IO_B_io[4] EXT_IO_B_io[5] EXT_IO_B_io[6] EXT_IO_B_io[7] EXT_IO_B_io[8] EXT_IO_B_io[9] EXT_IO_B_io[10] EXT_IO_B_io[11]}]
154164
set_input_delay -clock pclk_sdp -clock_fall -min $sdp_dmin $sdp_inputs -add_delay
155165
set_input_delay -clock pclk_sdp -clock_fall -max $sdp_dmax $sdp_inputs -add_delay
166+
167+
# PCM1808
168+
set_input_delay 0 -clock bck_extpcm -clock_fall [get_ports {EXT_IO_B_io[13] EXT_IO_B_io[14]}]
156169
} else {
157170
set_false_path -from [get_ports {EXT_IO_A_io* EXT_IO_B_io*}]
158171
}

software/sys_controller/src/firmware.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int fw_update(char *dirname, char *filename) {
147147
}
148148

149149
// commit FW update. Do not call functions located in flash during update
150-
void __attribute__((noinline, __section__(".text_bram"))) fw_update_commit(fw_header *hdr) {
150+
void __attribute__((noinline, flatten, noreturn, __section__(".text_bram"))) fw_update_commit(fw_header *hdr) {
151151
int i, j, sectors;
152152
uint32_t addr;
153153
uint32_t *data_from, *data_to, *data_end;

software/sys_controller/src/flash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <unistd.h>
2121
#include "flash.h"
2222

23-
void __attribute__((noinline, __section__(".text_bram"))) flash_write_protect(flash_ctrl_dev *dev, int enable) {
23+
void __attribute__((noinline, flatten, __section__(".text_bram"))) flash_write_protect(flash_ctrl_dev *dev, int enable) {
2424
// Write enable
2525
dev->regs->flash_cmd_cfg = 0x00000006;
2626
dev->regs->flash_cmd_ctrl = 1;
@@ -43,7 +43,7 @@ void __attribute__((noinline, __section__(".text_bram"))) flash_write_protect(fl
4343
dev->regs->flash_cmd_ctrl = 1;
4444
}
4545

46-
void __attribute__((noinline, __section__(".text_bram"))) flash_sector_erase(flash_ctrl_dev *dev, uint32_t addr) {
46+
void __attribute__((noinline, flatten, __section__(".text_bram"))) flash_sector_erase(flash_ctrl_dev *dev, uint32_t addr) {
4747
// Write enable
4848
dev->regs->flash_cmd_cfg = 0x00000006;
4949
dev->regs->flash_cmd_ctrl = 1;

software/sys_controller/src/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ uint32_t gcd(uint32_t a, uint32_t b)
4141
}
4242

4343
#ifdef HW_CRC32_0_BASE
44-
unsigned long __attribute__((noinline, __section__(".text_bram"))) crc32(unsigned char *input_data, unsigned long input_data_length, int do_initialize)
44+
unsigned long __attribute__((noinline, flatten, __section__(".text_bram"))) crc32(unsigned char *input_data, unsigned long input_data_length, int do_initialize)
4545
{
4646
unsigned long index;
4747

software/sys_controller_bsp/HAL/src/alt_busy_sleep.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
/*
2-
* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA.
2+
* Copyright (c) 2003-2004 Altera Corporation, San Jose, California, USA.
33
* All rights reserved.
4-
*
4+
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
6-
* of this software and associated documentation files (the "Software"), to
7-
* deal in the Software without restriction, including without limitation the
6+
* of this software and associated documentation files (the "Software"), to
7+
* deal in the Software without restriction, including without limitation the
88
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9-
* sell copies of the Software, and to permit persons to whom the Software is
9+
* sell copies of the Software, and to permit persons to whom the Software is
1010
* furnished to do so, subject to the following conditions:
1111
*
12-
* The above copyright notice and this permission notice shall be included in
12+
* The above copyright notice and this permission notice shall be included in
1313
* all copies or substantial portions of the Software.
14-
*
15-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2121
* DEALINGS IN THE SOFTWARE.
22-
*
22+
*
2323
* ------------
2424
*
25-
* Altera does not recommend, suggest or require that this reference design
25+
* Altera does not recommend, suggest or require that this reference design
2626
* file be used in conjunction or combination with any other product.
2727
*
2828
* alt_busy_sleep.c - Microsecond delay routine which uses a calibrated busy
2929
* loop to perform the delay. This is used to implement
30-
* usleep for both uC/OS-II and the standalone HAL.
30+
* usleep for both uC/OS-II and the standalone HAL.
3131
*
3232
* Author PRR
3333
*
3434
* Calibrated delay with no timer required
35-
*
36-
* The ASM instructions in the routine are equivalent to
35+
*
36+
* The ASM instructions in the routine are equivalent to
3737
*
3838
* for (i=0;i<us*(ALT_CPU_FREQ/3);i++);
39-
*
39+
*
4040
* and takes three cycles each time around the loop
4141
*
4242
*/
@@ -52,7 +52,7 @@
5252
#include "altera_avalon_timer.h"
5353
#include "sys/alt_timestamp.h"
5454

55-
unsigned int __attribute__((noinline, __section__(".text_bram"))) alt_busy_sleep (unsigned int us)
55+
unsigned int __attribute__((noinline, flatten, __section__(".text_bram"))) alt_busy_sleep (unsigned int us)
5656
{
5757
/*
5858
* Only delay if ALT_SIM_OPTIMIZE is not defined; i.e., if software

software/sys_controller_bsp/drivers/src/altera_avalon_timer_ts.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,20 @@
4545
* for this system.
4646
*/
4747

48-
#if (ALT_TIMESTAMP_CLK_BASE != none_BASE)
48+
#if (ALT_TIMESTAMP_CLK_BASE != none_BASE)
4949

5050
/*
5151
* The function alt_timestamp_start() can be called at application level to
5252
* initialise the timestamp facility. In this case the period register is
5353
* set to full scale, i.e. 0xffffffff, and then started running. Note that
54-
* the period register may not be writable, depending on the hardware
54+
* the period register may not be writable, depending on the hardware
5555
* configuration, in which case this function does not reset the period.
5656
*
5757
* The timer is not run in continuous mode, so that the user can detect timer
5858
* roll-over, i.e. alt_timestamp() returns 0.
5959
*
6060
* The return value of this function is 0 upon sucess and -1 if in timestamp
61-
* device has not been registered.
61+
* device has not been registered.
6262
*/
6363

6464
int alt_timestamp_start(void)
@@ -82,8 +82,8 @@ int alt_timestamp_start(void)
8282
IOWR_ALTERA_AVALON_TIMER_CONTROL (base,ALTERA_AVALON_TIMER_CONTROL_STOP_MSK);
8383
IOWR_ALTERA_AVALON_TIMER_PERIODL (base, 0xFFFF);
8484
IOWR_ALTERA_AVALON_TIMER_PERIODH (base, 0xFFFF);
85-
IOWR_ALTERA_AVALON_TIMER_CONTROL (base, ALTERA_AVALON_TIMER_CONTROL_START_MSK);
86-
}
85+
IOWR_ALTERA_AVALON_TIMER_CONTROL (base, ALTERA_AVALON_TIMER_CONTROL_START_MSK);
86+
}
8787
}
8888
return 0;
8989
}
@@ -94,10 +94,10 @@ int alt_timestamp_start(void)
9494
* function return -1.
9595
*
9696
* The returned timestamp counts up from the last time the period register
97-
* was reset.
97+
* was reset.
9898
*/
9999

100-
alt_timestamp_type __attribute__((noinline, __section__(".text_bram"))) alt_timestamp(void)
100+
alt_timestamp_type __attribute__((noinline, flatten, __section__(".text_bram"))) alt_timestamp(void)
101101
{
102102

103103
void* base = altera_avalon_timer_ts_base;
@@ -118,14 +118,14 @@ alt_timestamp_type __attribute__((noinline, __section__(".text_bram"))) alt_time
118118
alt_timestamp_type snap_1 = IORD_ALTERA_AVALON_TIMER_SNAP_1(base) & ALTERA_AVALON_TIMER_SNAP_1_MSK;
119119
alt_timestamp_type snap_2 = IORD_ALTERA_AVALON_TIMER_SNAP_2(base) & ALTERA_AVALON_TIMER_SNAP_2_MSK;
120120
alt_timestamp_type snap_3 = IORD_ALTERA_AVALON_TIMER_SNAP_3(base) & ALTERA_AVALON_TIMER_SNAP_3_MSK;
121-
121+
122122
return (0xFFFFFFFFFFFFFFFFULL - ( (snap_3 << 48) | (snap_2 << 32) | (snap_1 << 16) | (snap_0) ));
123123
#else
124124
IOWR_ALTERA_AVALON_TIMER_SNAPL (base, 0);
125125
alt_timestamp_type lower = IORD_ALTERA_AVALON_TIMER_SNAPL(base) & ALTERA_AVALON_TIMER_SNAPL_MSK;
126126
alt_timestamp_type upper = IORD_ALTERA_AVALON_TIMER_SNAPH(base) & ALTERA_AVALON_TIMER_SNAPH_MSK;
127-
128-
return (0xFFFFFFFF - ((upper << 16) | lower));
127+
128+
return (0xFFFFFFFF - ((upper << 16) | lower));
129129
#endif
130130
}
131131
}
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)