@@ -20,6 +20,7 @@ import { SerialPort } from "serialport";
2020import { getConfig } from "../Config" ;
2121import { Controller } from "../controller" ;
2222import { Tests } from "../SelfTest" ;
23+ import { getLanguage } from "../Spawn/Language" ;
2324import { ExecType , RunType } from "../Spawn/Language/decl" ;
2425import { MeterResult } from "../Spawn/Meter" ;
2526import { ExecutableAgent , runLogName } from "./ExecutableAgent" ;
@@ -238,24 +239,11 @@ export abstract class JudgeAgent {
238239 }
239240 ) : Promise < [ ExecutableAgent , JudgeResult | undefined ] > {
240241 this . checkInit ( ) ;
241- const executableAgent = new ExecutableAgent ( execType , executable , [
242- {
243- name : "ax309.ucf" ,
244- type : "builtin" ,
245- } ,
246- {
247- name : "main.cmd" ,
248- type : "builtin" ,
249- } ,
250- {
251- name : "verilog.prj" ,
252- type : "builtin" ,
253- } ,
254- {
255- name : "xc6slx9-2-ftg256.verilog.xst" ,
256- type : "builtin" ,
257- } ,
258- ] ) ;
242+ const executableAgent = new ExecutableAgent (
243+ execType ,
244+ executable ,
245+ this . judge . dynamicFiles
246+ ) ;
259247 this . ExecutableAgents . push ( executableAgent ) ;
260248 await executableAgent . init ( ) ;
261249 await executableAgent . releaseFile ( ) ;
@@ -286,14 +274,14 @@ export abstract class JudgeAgent {
286274 statistics . tick ( this . judge . id ) ;
287275 await this . init ( ) ;
288276 const ret = await this . getResult ( ) ;
289- // await this.clean();
277+ await this . clean ( ) ;
290278 statistics . finish ( this . judge . id ) ;
291279 return ret ;
292280 } catch ( err ) {
293281 this . logger . fatal ( err ) ;
294- // await this.clean().catch((error) => {
295- // this.logger.fatal(error);
296- // });
282+ await this . clean ( ) . catch ( ( error ) => {
283+ this . logger . fatal ( error ) ;
284+ } ) ;
297285 statistics . finish ( this . judge . id ) ;
298286 const e = {
299287 kind : JudgeResultKind . SystemError ,
@@ -568,6 +556,19 @@ export class JudgeFactory {
568556 ) { }
569557
570558 getJudgerAgent ( judgeInfo : CreateJudgeArgs ) : JudgeAgent {
559+ judgeInfo . dynamicFiles = [
560+ {
561+ type : "builtin" ,
562+ name : getConfig ( ) . fpga . constraints ,
563+ } ,
564+ {
565+ type : "builtin" ,
566+ name : getConfig ( ) . fpga . program ,
567+ } ,
568+ ...getLanguage (
569+ judgeInfo . judge . user . environment . language
570+ ) . modifyDynamicFile ( judgeInfo . dynamicFiles ) ,
571+ ] ;
571572 judgeInfo . judge . user . limit . compiler . cpuTime = Math . ceil (
572573 judgeInfo . judge . user . limit . compiler . cpuTime / this . timeRatio
573574 ) ;
0 commit comments