With the globalization of the semiconductor industry, the supply chain is fragmented across geographies, which has resulted in the importing of third-party IP cores in designs. Such third party IP cores have increased concerns about hardware Trojans. To address such concerns, development of an effective Trojan detection methodology is crucial. In this article, we present a low-cost Trojan detection and activation prevention mechanism for high level synthesis. In particular, a particle swarm optimization-based design space exploration method is proposed which is combined with a Trojan detection mechanism to minimize resource requirements. Additionally, a hybrid evolutionary algorithm-based Trojan detection method is formed with a novel vendor allocation procedure to find low-cost solutions. The proposed algorithm is compared with existing methods-based on Pareto and non-Pareto-based evaluations to verify their efficiency. From the experiment results, it has been verified that the proposed algorithm offers defence against Trojans similar to existing algorithms with less hardware overhead.