Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

Could someone have an idea?

Ok. I have 4 modules that it depends on GPIO or Switch Hi or Lo

module From_SPISlave() and module To_UART();

module From_UART() and module To_SPIMaster();

if (Switch is Hi) then I run the first: From_SPISlave() and To_UART();

if (Switch is Lo) then I run the second: From_UART() and To_SPIMaster();

How do I design this in top level?

Thanks,

Sean

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Modules are not run, they are placed like chips on a circuit board. It sounds like you need a mux....

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks Tricky,

    In my design right now, I have these layout

    module Top();

    switch;

    From_SPISlave(;;;;;;);

    To_UART(;;;;;;);

    From_UART(;;;;;;;);

    To_SPIMaster(;;;;;;);

    endmodule

    Do you have any pointers how to use mux?

    Sean