config: topologies: slight code refactor (transplanted from eca928d8a4ab26016f26e12e233ab0d0dcdcef4e)
config: topologies: slight code refactor
(transplanted from eca928d8a4ab26016f26e12e233ab0d0dcdcef4e)

LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5