Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changin the working frequency of the pynq-z2 board #397

Open
Clay-Cui opened this issue Jun 7, 2022 · 1 comment
Open

Changin the working frequency of the pynq-z2 board #397

Clay-Cui opened this issue Jun 7, 2022 · 1 comment
Labels

Comments

@Clay-Cui
Copy link

Clay-Cui commented Jun 7, 2022

Hi, I'm currently working with vexriscv on the tul pynq-z2 board. Unlike other people, I need to turn down the clock frequency of the core to make side-channel power measurements more feasible. The standard clock frequency is the clock provided by the Ethernet port, which is 125Mhz, is there a way to turn it down to like, 25Mhz?
`class BaseSoC(SoCCore):
def init(self, platform):
sys_clk_freq = int(125e6)

    # SoC with CPU
    SoCCore.__init__(self, platform,
        cpu_type                 = "vexriscv",
        cpu_variant              = "gfmulex_vector", 
        # cpu_cfu                  = "",         
        clk_freq                 = 125e6,
        ident                    = "LiteX VexRiscV Test SoC", ident_version=True,
        integrated_rom_size      = 0x8000,
        integrated_sram_size     = 0x4000,
        integrated_main_ram_size = 0x8000,
        uart_baudrate            = 19200)`

I tried to change the parameter sys_clk_freq and clk_freq in this python class, but it seems that I can't get correct behavior from the uart. Is it correct to change the uart baudrate here? Or I need to configure other things?
Thank you in advance!

@enjoy-digital
Copy link
Member

Hi @Clay-Cui,

If you target file has a CRG similar to this: https://github.com/litex-hub/litex-boards/blob/master/litex_boards/targets/digilent_pynq_z1.py#L24-L55, reducing the sys_clk_freq to 25MHz should only be a matter of passing --sys-clk-freq=25e6 to your build command.

Changing only clk_freq parameter of SoCCore will not work since this is only an indication for SoCCore, the frequency change has to be done on the CRG.

If this is not working, please share some code to ease support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants