ADS学习日志
2017-11-23 13:58
891 查看
ADS学习日志
AEL脚本decl CKT_BATCH_QUEUE_STATE; decl CKT_NUM = 0; decl i = 0; decl j = 0; decl k = 0; defun mybatch_simulation() { if(ckt_simulaion_is_running()) { de_info("A circuit simulation is currently running.\nPlease wait until this simulation is done."); return; } // desim_use_queued_simulators() was introduced in ADS 2004A // This line makes sure the code works in earlier versions if ( ! is_word( find_word( "desim_use_queued_simulators" ) ) ) execute( "defun desim_use_queued_simulators( ) { return FALSE; }" ); // Save the queue state CKT_BATCH_QUEUE_STATE = desim_use_queued_simulators(FALSE); mybatch_simulate_design(); } defun mybatch_simulate_design() { k = CKT_NUM%5; j = ((CKT_NUM-k)/5)%4; i = (((CKT_NUM-k)/5-j)/4)%2; // Open desired schematic //de_open_design("mybatch_test",FALSE); // Tweak to desired name.. de_set_window_by_sequence(0, 0); de_open_workspace("E:\ADS\LTE\QYL_LTE_TESTwrk"); //de_bring_view_to_top_or_open_new_window("QYL_LTE_TESTwrk1_lib_1", "LTE", "schematic", 3); de_get_design_context_from_name("QYL_LTE_TESTwrk1_lib:LTE:schematic"); decl itemInfo0SP=de_edit_item("VAR2"); de_set_item_id(itemInfo0SP, "VAR2"); de_set_item_parameters(itemInfo0SP, list(list(prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","CType1"),prm_ex("ads_datacmps","VarValueForm",i)),prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","CType"),prm_ex("ads_datacmps","VarValueForm","if (CType1==0) then 0 elseif (CType1==1) then 2 else 0 endif"))))); de_end_edit_item(itemInfo0SP); itemInfo0SP=de_free_item(itemInfo0SP); decl itemInfo1SP=de_edit_item("SNR_Computation1"); de_set_item_id(itemInfo1SP, "SNR_Computation1"); de_set_item_parameters(itemInfo1SP, list(list(prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","SNR1"),prm_ex("ads_datacmps","VarValueForm",j)),prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","RS_EPRE"),prm_ex("ads_datacmps","VarValueForm","-25")),prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","NDensity"),prm_ex("ads_datacmps","VarValueForm","RS_EPRE-10*log10(15e3)-SNR")),prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","SNR"),prm_ex("ads_datacmps","VarValueForm","if (SNR1==0) then 0 elseif (SNR1==1) then -10 elseif (SNR1==2) then -20 elseif (SNR1==3) then -30 else 0 endif"))))); de_end_edit_item(itemInfo1SP); itemInfo1SP=de_free_item(itemInfo1SP); decl itemInfo2SP=de_edit_item("VAR1"); de_set_item_id(itemInfo2SP, "VAR1"); de_set_item_parameters(itemInfo2SP, list(list(prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","LoFreq"),prm_ex("ads_datacmps","VarValueForm","1895e6+LoFreq2 Hz")),prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","LoFreq1"),prm_ex("ads_datacmps","VarValueForm",k)),prm_ex("ads_datacmps","VarFormEditcompPowerVar",prm_ex("ads_datacmps","VarNameForm","LoFreq2"),prm_ex("ads_datacmps","VarValueForm","if (LoFreq1==0) then 0 elseif (LoFreq1==1) then 100 elseif (LoFreq1==2) then 1000 elseif (LoFreq1==3) then 10000 elseif (LoFreq1==4) then 100000 else 0 endif"))))); de_end_edit_item(itemInfo2SP); itemInfo2SP=de_free_item(itemInfo2SP); // Simulate it decl wInst=api_get_current_window(); de_analyze(); // Wait for the simulation to finish // install a timer function api_set_timer("cktSimTimer", // timer name 1000, // number of milliseconds b/n calls 1, // auto repeat "ckt_sim_check_timer_cb", // callback NULL); // cbData of callback } defun ckt_sim_check_timer_cb (cbData, callData) { if (!ckt_simulaion_is_running()) { // make sure to remove timer function api_remove_timer("cktSimTimer"); // Increase Design Number CKT_NUM++; // More designs to simulate? if ( CKT_NUM < 4000 span class="hljs-subst"><= 39 ) mybatch_simulate_design(); else { // Reset the queue state desim_use_queued_simulators(CKT_BATCH_QUEUE_STATE); de_info("Done!"); } } } defun ckt_simulaion_is_running() { //decl dsnDir = de_current_design_name(); //decl workDir = de_mom_get_working_dir(db_get_design(dsnDir)); if (desim_foreground_simulation_running()) { return TRUE; } else { return FALSE; } } mybatch_simulation();
相关文章推荐
- Redis学习日志【三、jedis+struts2】
- 建站学习(PHP+apache+mysql):2 将日志在页面展示
- java学习日志(二)---实验1
- CUDA学习日志:开发环境配置和学习资源
- EmguCV的学习日志(一)
- Kafka学习6_关于Kafka 的消息日志Offset 的了解
- SODBASE CEP学习进阶篇(二)续:日志采集之外的APM探针方法
- Tomcat原理学习---日志系统
- python学习日志1
- 2018.1.8学习日志gdb
- .Net语言 APP开发平台——Smobiler学习日志:如何快速实现手机上的资源上传功能
- 编译的学习和实践日志七[有穷自动机]
- ElasticSearch学习日志(二)
- 日志框架学习(3)— Log4j详细使用教程
- 20130912 学习日志
- python学习日志11
- Java学习日志01
- python 的日志logging模块学习
- python 的日志logging模块学习
- 每日学习日志20111209